diff options
author | Timo Sirainen <cras@irssi.org> | 2002-02-08 07:25:51 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2002-02-08 07:25:51 +0000 |
commit | 2f09d9be5ae720eb3dd69f016f239d1b5a6eecad (patch) | |
tree | 59d5a6a6897d199a03dc7934dd8b8469fc6ab6c7 /src/irc | |
parent | b058b9740c813b5b8ea321caf8a845797ad3a982 (diff) | |
download | irssi-2f09d9be5ae720eb3dd69f016f239d1b5a6eecad.zip |
Proxy is now emitting "proxy client connected" and "proxy client
disconnected" signals.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2404 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/irc')
-rw-r--r-- | src/irc/proxy/listen.c | 10 | ||||
-rw-r--r-- | src/irc/proxy/module.h | 2 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/irc/proxy/listen.c b/src/irc/proxy/listen.c index 750adf7a..d7486af8 100644 --- a/src/irc/proxy/listen.c +++ b/src/irc/proxy/listen.c @@ -42,11 +42,16 @@ static void remove_client(CLIENT_REC *rec) proxy_clients = g_slist_remove(proxy_clients, rec); + signal_emit("proxy client disconnected", 1, rec); + printtext(NULL, NULL, MSGLEVEL_CLIENTNOTICE, + "Proxy: Client disconnected from %s", rec->host); + g_free(rec->proxy_address); net_disconnect(rec->handle); g_source_remove(rec->tag); line_split_free(rec->buffer); g_free_not_null(rec->nick); + g_free_not_null(rec->host); g_free(rec); } @@ -293,6 +298,7 @@ static void sig_listen(LISTEN_REC *listen) rec = g_new0(CLIENT_REC, 1); rec->listen = listen; rec->handle = handle; + rec->host = g_strdup(host); if (strcmp(listen->ircnet, "*") == 0) { rec->proxy_address = g_strdup("irc.proxy"); rec->server = servers == NULL ? NULL : IRC_SERVER(servers->data); @@ -305,8 +311,10 @@ static void sig_listen(LISTEN_REC *listen) (GInputFunction) sig_listen_client, rec); proxy_clients = g_slist_append(proxy_clients, rec); + + signal_emit("proxy client connected", 1, rec); printtext(NULL, NULL, MSGLEVEL_CLIENTNOTICE, - "Proxy: Client connected from %s", host); + "Proxy: Client connected from %s", rec->host); } static void sig_incoming(IRC_SERVER_REC *server, const char *line) diff --git a/src/irc/proxy/module.h b/src/irc/proxy/module.h index dfc67be7..99f99e54 100644 --- a/src/irc/proxy/module.h +++ b/src/irc/proxy/module.h @@ -18,7 +18,7 @@ typedef struct { typedef struct { LINEBUF_REC *buffer; - char *nick; + char *nick, *host; GIOChannel *handle; int tag; |