summaryrefslogtreecommitdiff
path: root/src/irc
diff options
context:
space:
mode:
Diffstat (limited to 'src/irc')
-rw-r--r--src/irc/proxy/Makefile.am3
-rw-r--r--src/irc/proxy/listen.c14
-rw-r--r--src/irc/proxy/module.h23
-rw-r--r--src/irc/proxy/proxy.h33
4 files changed, 50 insertions, 23 deletions
diff --git a/src/irc/proxy/Makefile.am b/src/irc/proxy/Makefile.am
index bf80bc2d..8a5b5046 100644
--- a/src/irc/proxy/Makefile.am
+++ b/src/irc/proxy/Makefile.am
@@ -21,7 +21,8 @@ libirc_proxy_la_SOURCES = \
listen.c
noinst_HEADERS = \
- module.h
+ module.h \
+ proxy.h
clean-generic:
rm -f libirc_proxy.a
diff --git a/src/irc/proxy/listen.c b/src/irc/proxy/listen.c
index 5e7497c1..5f473a34 100644
--- a/src/irc/proxy/listen.c
+++ b/src/irc/proxy/listen.c
@@ -186,6 +186,8 @@ static void handle_client_cmd(CLIENT_REC *client, char *cmd, char *args,
client->want_ctcp = 0;
proxy_outdata(client, ":%s NOTICE %s :Proxy is now handling itself CTCPs sent to %s\n",
client->proxy_address, client->nick, client->listen->ircnet);
+ } else {
+ signal_emit("proxy client command", 3, client, args, data);
}
return;
}
@@ -663,6 +665,14 @@ static void read_settings(void)
}
}
+static void sig_dump(CLIENT_REC *client, const char *data)
+{
+ g_return_if_fail(client != NULL);
+ g_return_if_fail(data != NULL);
+
+ proxy_outdata(client, data);
+}
+
void proxy_listen_init(void)
{
next_line = g_string_new(NULL);
@@ -680,6 +690,8 @@ void proxy_listen_init(void)
signal_add("message own_private", (SIGNAL_FUNC) sig_message_own_private);
signal_add("message irc own_action", (SIGNAL_FUNC) sig_message_own_action);
signal_add("setup changed", (SIGNAL_FUNC) read_settings);
+
+ signal_add("proxy client dump", (SIGNAL_FUNC) sig_dump);
}
void proxy_listen_deinit(void)
@@ -697,4 +709,6 @@ void proxy_listen_deinit(void)
signal_remove("message own_private", (SIGNAL_FUNC) sig_message_own_private);
signal_remove("message irc own_action", (SIGNAL_FUNC) sig_message_own_action);
signal_remove("setup changed", (SIGNAL_FUNC) read_settings);
+
+ signal_remove("proxy client dump", (SIGNAL_FUNC) sig_dump);
}
diff --git a/src/irc/proxy/module.h b/src/irc/proxy/module.h
index e2580e1b..ff95227f 100644
--- a/src/irc/proxy/module.h
+++ b/src/irc/proxy/module.h
@@ -6,28 +6,7 @@
#include "irc.h"
#include "irc-servers.h"
-typedef struct {
- int port;
- char *ircnet;
-
- int tag;
- GIOChannel *handle;
-
- GSList *clients;
-} LISTEN_REC;
-
-typedef struct {
- char *nick, *host;
- NET_SENDBUF_REC *handle;
- int recv_tag;
- char *proxy_address;
- LISTEN_REC *listen;
- IRC_SERVER_REC *server;
- unsigned int pass_sent:1;
- unsigned int user_sent:1;
- unsigned int connected:1;
- unsigned int want_ctcp:1;
-} CLIENT_REC;
+#include "proxy.h"
extern GSList *proxy_listens;
extern GSList *proxy_clients;
diff --git a/src/irc/proxy/proxy.h b/src/irc/proxy/proxy.h
new file mode 100644
index 00000000..4ddc9da9
--- /dev/null
+++ b/src/irc/proxy/proxy.h
@@ -0,0 +1,33 @@
+#ifndef PROXY_H
+#define PROXY_H
+
+#include "common.h"
+
+#include "network.h"
+#include "irc.h"
+#include "irc-servers.h"
+
+typedef struct {
+ int port;
+ char *ircnet;
+
+ int tag;
+ GIOChannel *handle;
+
+ GSList *clients;
+} LISTEN_REC;
+
+typedef struct {
+ char *nick, *host;
+ NET_SENDBUF_REC *handle;
+ int recv_tag;
+ char *proxy_address;
+ LISTEN_REC *listen;
+ IRC_SERVER_REC *server;
+ unsigned int pass_sent:1;
+ unsigned int user_sent:1;
+ unsigned int connected:1;
+ unsigned int want_ctcp:1;
+} CLIENT_REC;
+
+#endif