diff options
author | Timo Sirainen <cras@irssi.org> | 2004-02-18 15:07:44 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2004-02-18 15:07:44 +0000 |
commit | 77cd7170f2ddb3e64e4f4b0fb95853f81cb1e23a (patch) | |
tree | d3974e701e8a2b3bbb33845315866bfaed2d7a96 /src/core/chat-commands.c | |
parent | f2e9b8b3958937ee34d183c332f3928502d39d10 (diff) | |
download | irssi-77cd7170f2ddb3e64e4f4b0fb95853f81cb1e23a.zip |
Added "server sendmsg" signal to replace server->send_message().
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3226 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/core/chat-commands.c')
-rw-r--r-- | src/core/chat-commands.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/core/chat-commands.c b/src/core/chat-commands.c index f3197520..0036fec8 100644 --- a/src/core/chat-commands.c +++ b/src/core/chat-commands.c @@ -396,8 +396,10 @@ static void cmd_msg(const char *data, SERVER_REC *server, WI_ITEM_REC *item) } } - if (target != NULL) - server->send_message(server, target, msg, target_type); + if (target != NULL) { + signal_emit("server sendmsg", 4, server, target, msg, + GINT_TO_POINTER(target_type)); + } signal_emit(target != NULL && target_type == SEND_TARGET_CHANNEL ? "message own_public" : "message own_private", 4, server, msg, target, origtarget); @@ -406,6 +408,13 @@ static void cmd_msg(const char *data, SERVER_REC *server, WI_ITEM_REC *item) cmd_params_free(free_arg); } +static void sig_server_sendmsg(SERVER_REC *server, const char *target, + const char *msg, void *target_type_p) +{ + server->send_message(server, target, msg, + GPOINTER_TO_INT(target_type_p)); +} + static void cmd_foreach(const char *data, SERVER_REC *server, WI_ITEM_REC *item) { @@ -468,7 +477,8 @@ void chat_commands_init(void) command_bind("foreach channel", NULL, (SIGNAL_FUNC) cmd_foreach_channel); command_bind("foreach query", NULL, (SIGNAL_FUNC) cmd_foreach_query); - signal_add("default command server", (SIGNAL_FUNC) sig_default_command_server); + signal_add("default command server", (SIGNAL_FUNC) sig_default_command_server); + signal_add("server sendmsg", (SIGNAL_FUNC) sig_server_sendmsg); command_set_options("connect", "4 6 !! ssl +ssl_cert +ssl_pkey ssl_verify +ssl_cafile +ssl_capath +host noproxy -rawlog"); command_set_options("join", "invite"); @@ -490,4 +500,5 @@ void chat_commands_deinit(void) command_unbind("foreach query", (SIGNAL_FUNC) cmd_foreach_query); signal_remove("default command server", (SIGNAL_FUNC) sig_default_command_server); + signal_remove("server sendmsg", (SIGNAL_FUNC) sig_server_sendmsg); } |