diff options
author | Timo Sirainen <cras@irssi.org> | 2001-01-01 16:57:25 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2001-01-01 16:57:25 +0000 |
commit | 2ae679be088b0c726bf1c482fd22ee3231c94349 (patch) | |
tree | 804506241870ee73d6506c731a4e72f7f7d90e1b /src/core/chat-commands.c | |
parent | 219c83ae6ab83e546fe18bc697ef3a1ab3d12caa (diff) | |
download | irssi-2ae679be088b0c726bf1c482fd22ee3231c94349.zip |
added "message own_public" and "message own_private" events that are
sent when /msg command is used. this way we don't need to parse the
/msg's options everywhere. also efnet @#channels support works now better.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1041 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/core/chat-commands.c')
-rw-r--r-- | src/core/chat-commands.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/core/chat-commands.c b/src/core/chat-commands.c index 969be382..22dc9e4f 100644 --- a/src/core/chat-commands.c +++ b/src/core/chat-commands.c @@ -62,7 +62,7 @@ static void cmd_join(const char *data, SERVER_REC *server) static void cmd_msg(const char *data, SERVER_REC *server, WI_ITEM_REC *item) { GHashTable *optlist; - char *target, *msg; + char *target, *origtarget, *msg; void *free_arg; int free_ret; @@ -78,16 +78,23 @@ static void cmd_msg(const char *data, SERVER_REC *server, WI_ITEM_REC *item) if (server == NULL || !server->connected) cmd_param_error(CMDERR_NOT_CONNECTED); + origtarget = target; free_ret = FALSE; if (strcmp(target, ",") == 0 || strcmp(target, ".") == 0) { target = parse_special(&target, server, item, NULL, &free_ret, NULL, 0); + if (target != NULL && *target == '\0') + target = NULL; } else if (strcmp(target, "*") == 0 && item != NULL) target = item->name; if (target != NULL) server->send_message(server, target, msg); + signal_emit(target != NULL && server->ischannel(target) ? + "message own_public" : "message own_private", 4, + server, msg, target, origtarget); + if (free_ret && target != NULL) g_free(target); cmd_params_free(free_arg); } |