summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/perl.txt7
-rw-r--r--docs/signals.txt1
-rw-r--r--src/core/chat-commands.c17
3 files changed, 22 insertions, 3 deletions
diff --git a/docs/perl.txt b/docs/perl.txt
index cf390a74..9d866ef4 100644
--- a/docs/perl.txt
+++ b/docs/perl.txt
@@ -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
diff --git a/docs/signals.txt b/docs/signals.txt
index 1cc24a4f..62911971 100644
--- a/docs/signals.txt
+++ b/docs/signals.txt
@@ -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"
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);
}