Mercurial > pidgin.yaz
changeset 11083:8faabf4081ca
[gaim-migrate @ 13101]
sf patch #1225691, from Levi Bard
Implements gc->keepalive for irc
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Mon, 11 Jul 2005 00:36:28 +0000 |
parents | e25575a59f01 |
children | 2c21bffa8200 |
files | src/protocols/irc/irc.c |
diffstat | 1 files changed, 12 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/protocols/irc/irc.c Sun Jul 10 22:12:37 2005 +0000 +++ b/src/protocols/irc/irc.c Mon Jul 11 00:36:28 2005 +0000 @@ -51,6 +51,7 @@ static void irc_close(GaimConnection *gc); static int irc_im_send(GaimConnection *gc, const char *who, const char *what, GaimConvImFlags flags); static int irc_chat_send(GaimConnection *gc, int id, const char *what); +static void irc_ping_server(GaimConnection *gc); static void irc_chat_join (GaimConnection *gc, GHashTable *data); static void irc_input_cb(gpointer data, gint source, GaimInputCondition cond); static void irc_input_cb_ssl(gpointer data, GaimSslConnection *gsc, GaimInputCondition cond); @@ -627,6 +628,16 @@ return 0; } +static void irc_ping_server(GaimConnection *gc) +{ + struct irc_conn *irc = gc->proto_data; + gchar *buf; + + buf = irc_format(irc, "vv", "PING", irc->server); + irc_send(irc, buf); + g_free(buf); +} + static guint irc_nick_hash(const char *nick) { char *lc; @@ -778,7 +789,7 @@ irc_chat_leave, /* chat_leave */ NULL, /* chat_whisper */ irc_chat_send, /* chat_send */ - NULL, /* keepalive */ + irc_ping_server, /* keepalive */ NULL, /* register_user */ NULL, /* get_cb_info */ NULL, /* get_cb_away */