summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-10-19 11:28:56 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-10-19 11:28:56 +0000
commit40edf12dcadf0eeb140c89b0f1b121aae3a36616 (patch)
treee9a8d6ce8540b7136c761cfcb24f8a69d90fca32
parent1e87b0b59fbc614d08686ec12185ce7130ec76a7 (diff)
downloadirssi-40edf12dcadf0eeb140c89b0f1b121aae3a36616.zip
Actions are now transferred correctly, own messages in main irssi are
transferred now to clients. Patch by ganesh@earth.li. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1848 dbcabf3a-b0e7-0310-adc4-f8d773084564
-rw-r--r--src/irc/proxy/dump.c4
-rw-r--r--src/irc/proxy/listen.c14
-rw-r--r--src/irc/proxy/module.h2
3 files changed, 17 insertions, 3 deletions
diff --git a/src/irc/proxy/dump.c b/src/irc/proxy/dump.c
index 6e49df16..53c6d3c9 100644
--- a/src/irc/proxy/dump.c
+++ b/src/irc/proxy/dump.c
@@ -88,7 +88,7 @@ void proxy_outserver(CLIENT_REC *client, const char *data, ...)
va_end(args);
}
-/*void proxy_outserver_all(IRC_SERVER_REC *server, const char *data, ...)
+void proxy_outserver_all(IRC_SERVER_REC *server, const char *data, ...)
{
va_list args;
GSList *tmp;
@@ -111,7 +111,7 @@ void proxy_outserver(CLIENT_REC *client, const char *data, ...)
g_free(str);
va_end(args);
-}*/
+}
void proxy_outserver_all_except(CLIENT_REC *client, const char *data, ...)
{
diff --git a/src/irc/proxy/listen.c b/src/irc/proxy/listen.c
index 92f63753..fb432332 100644
--- a/src/irc/proxy/listen.c
+++ b/src/irc/proxy/listen.c
@@ -443,6 +443,9 @@ static void event_nick(IRC_SERVER_REC *server, const char *data,
{
GSList *tmp;
+ if (!IS_IRC_SERVER(server))
+ return;
+
if (g_strcasecmp(orignick, server->nick) != 0)
return;
@@ -457,6 +460,15 @@ static void event_nick(IRC_SERVER_REC *server, const char *data,
}
}
+static void sig_message_own_public(IRC_SERVER_REC *server, const char *msg,
+ const char *target)
+{
+ if (!IS_IRC_SERVER(server))
+ return;
+
+ proxy_outserver_all(server, "PRIVMSG %s :%s", target, msg);
+}
+
static LISTEN_REC *find_listen(const char *ircnet, int port)
{
GSList *tmp;
@@ -557,6 +569,7 @@ void plugin_proxy_listen_init(void)
signal_add("event connected", (SIGNAL_FUNC) event_connected);
signal_add("server disconnected", (SIGNAL_FUNC) sig_server_disconnected);
signal_add("event nick", (SIGNAL_FUNC) event_nick);
+ signal_add("message own_public", (SIGNAL_FUNC) sig_message_own_public);
signal_add("setup changed", (SIGNAL_FUNC) read_settings);
}
@@ -573,5 +586,6 @@ void plugin_proxy_listen_deinit(void)
signal_remove("event connected", (SIGNAL_FUNC) event_connected);
signal_remove("server disconnected", (SIGNAL_FUNC) sig_server_disconnected);
signal_remove("event nick", (SIGNAL_FUNC) event_nick);
+ signal_remove("message own_public", (SIGNAL_FUNC) sig_message_own_public);
signal_remove("setup changed", (SIGNAL_FUNC) read_settings);
}
diff --git a/src/irc/proxy/module.h b/src/irc/proxy/module.h
index 8eecfc5c..3905a065 100644
--- a/src/irc/proxy/module.h
+++ b/src/irc/proxy/module.h
@@ -44,5 +44,5 @@ void plugin_proxy_dump_data(CLIENT_REC *client);
void proxy_outdata(CLIENT_REC *client, const char *data, ...);
void proxy_outdata_all(IRC_SERVER_REC *server, const char *data, ...);
void proxy_outserver(CLIENT_REC *client, const char *data, ...);
-/*void proxy_outserver_all(const char *data, ...);*/
+void proxy_outserver_all(IRC_SERVER_REC *server, const char *data, ...);
void proxy_outserver_all_except(CLIENT_REC *client, const char *data, ...);