diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2008-01-24 22:49:47 +0000 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2008-01-24 22:49:47 +0000 |
commit | b5c8a34aeff244ffe7a9f4bd5edf827495d0deea (patch) | |
tree | 150af59ea988a4d63e9b9a080db224ffcd84ffab /protocols/jabber/jabber.c | |
parent | 613cc5583465b2fa35288a2f28d0e408904c4fd9 (diff) |
Keeping track of valid Jabber connections so _connected() events will be
ignored if the connection's dead already. Necessary if using GLib for event
handling for now. :-/
Diffstat (limited to 'protocols/jabber/jabber.c')
-rw-r--r-- | protocols/jabber/jabber.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/protocols/jabber/jabber.c b/protocols/jabber/jabber.c index 264a0308..243ed7fd 100644 --- a/protocols/jabber/jabber.c +++ b/protocols/jabber/jabber.c @@ -34,6 +34,8 @@ #include "md5.h" #include "base64.h" +GSList *jabber_connections; + static void jabber_init( account_t *acc ) { set_t *s; @@ -70,6 +72,11 @@ static void jabber_login( account_t *acc ) struct ns_srv_reply *srv = NULL; char *connect_to, *s; + /* For now this is needed in the _connected() handlers if using + GLib event handling, to make sure we're not handling events + on dead connections. */ + jabber_connections = g_slist_prepend( jabber_connections, ic ); + jd->ic = ic; ic->proto_data = jd; @@ -262,6 +269,8 @@ static void jabber_logout( struct im_connection *ic ) g_free( jd->away_message ); g_free( jd->username ); g_free( jd ); + + jabber_connections = g_slist_remove( jabber_connections, ic ); } static int jabber_buddy_msg( struct im_connection *ic, char *who, char *message, int flags ) |