mirror of
https://github.com/irssi/irssi.git
synced 2025-01-03 14:56:47 -05:00
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
This commit is contained in:
parent
f2e9b8b395
commit
77cd7170f2
@ -935,6 +935,13 @@ Server::ctcp_send_reply(data)
|
||||
is the full raw command to be sent to server, like
|
||||
"NOTICE nick :\001VERSION irssi\001"
|
||||
|
||||
Server::isupport(name)
|
||||
Returns the value of the named item in the ISUPPORT (005) numeric to the
|
||||
script. If the item is not present returns undef, if the item has no value
|
||||
then "" is returned use defined $server->isupport("name") if you need to
|
||||
check whether a property is present.
|
||||
See http://www.ietf.org/internet-drafts/draft-brocklesby-irc-isupport-01.txt
|
||||
for more information on the ISUPPORT numeric.
|
||||
|
||||
*** IRC channels
|
||||
|
||||
|
@ -84,6 +84,7 @@ server.c:
|
||||
"server connect failed", SERVER_REC
|
||||
"server disconnected", SERVER_REC
|
||||
"server quit", SERVER_REC, char *msg
|
||||
"server sendmsg", SERVER_REC, char *target, char *msg, int target_type
|
||||
|
||||
settings.c:
|
||||
"setup changed"
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user