# HG changeset patch # User Mark Doliner # Date 1121042188 0 # Node ID 8faabf4081ca54be1df963da1b6ff2ed6a08901b # Parent e25575a59f01cd5e2ac3f074187fd7d2f1d0394d [gaim-migrate @ 13101] sf patch #1225691, from Levi Bard Implements gc->keepalive for irc committer: Tailor Script diff -r e25575a59f01 -r 8faabf4081ca src/protocols/irc/irc.c --- 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 */