1
0
mirror of https://github.com/irssi/irssi.git synced 2024-07-07 02:54:19 -04:00

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
This commit is contained in:
Timo Sirainen 2002-02-08 07:25:51 +00:00 committed by cras
parent b058b9740c
commit 2f09d9be5a
3 changed files with 15 additions and 2 deletions

View File

@ -215,6 +215,11 @@ notifylist.c:
"notifylist unidle", SERVER_REC, char *nick, char *user, char *host, char *realname, char *awaymsg
"notifylist left", SERVER_REC, char *nick, char *user, char *host, char *realname, char *awaymsg
proxy/listen.c:
"proxy client connected", CLIENT_REC
"proxy client disconnected", CLIENT_REC
FE common
---------

View File

@ -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)

View File

@ -18,7 +18,7 @@ typedef struct {
typedef struct {
LINEBUF_REC *buffer;
char *nick;
char *nick, *host;
GIOChannel *handle;
int tag;