# HG changeset patch # User Paul Aurich # Date 1244353005 0 # Node ID c8390dc125c12b96938d89427ef0c43605f2242e # Parent 93a41017dca979ef3adeb0fa2dd6ffa512658921 Use js->state to track whether the roster has been retrieved. diff -r 93a41017dca9 -r c8390dc125c1 libpurple/protocols/jabber/jabber.c --- a/libpurple/protocols/jabber/jabber.c Sun Jun 07 00:16:05 2009 +0000 +++ b/libpurple/protocols/jabber/jabber.c Sun Jun 07 05:36:45 2009 +0000 @@ -1613,7 +1613,8 @@ break; case JABBER_STREAM_CONNECTED: - /* now we can alert the core that we're ready to send status */ + /* Send initial presence */ + jabber_presence_send(js, TRUE); purple_connection_set_state(js->gc, PURPLE_CONNECTED); break; } diff -r 93a41017dca9 -r c8390dc125c1 libpurple/protocols/jabber/jabber.h --- a/libpurple/protocols/jabber/jabber.h Sun Jun 07 00:16:05 2009 +0000 +++ b/libpurple/protocols/jabber/jabber.h Sun Jun 07 05:36:45 2009 +0000 @@ -116,7 +116,6 @@ char *expected_rspauth; GHashTable *buddies; - gboolean roster_parsed; /* * This boolean was added to eliminate a heinous bug where we would diff -r 93a41017dca9 -r c8390dc125c1 libpurple/protocols/jabber/presence.c --- a/libpurple/protocols/jabber/presence.c Sun Jun 07 00:16:05 2009 +0000 +++ b/libpurple/protocols/jabber/presence.c Sun Jun 07 05:36:45 2009 +0000 @@ -133,7 +133,7 @@ status = purple_presence_get_active_status(p); /* we don't want to send presence before we've gotten our roster */ - if(!js->roster_parsed) { + if (js->state != JABBER_STREAM_CONNECTED) { purple_debug_info("jabber", "attempt to send presence before roster retrieved\n"); return; } diff -r 93a41017dca9 -r c8390dc125c1 libpurple/protocols/jabber/roster.c --- a/libpurple/protocols/jabber/roster.c Sun Jun 07 00:16:05 2009 +0000 +++ b/libpurple/protocols/jabber/roster.c Sun Jun 07 05:36:45 2009 +0000 @@ -244,13 +244,10 @@ js->currently_parsing_roster_push = FALSE; /* if we're just now parsing the roster for the first time, - * then now would be the time to declare ourselves connected and - * send our initial presence */ - if(!js->roster_parsed) { - js->roster_parsed = TRUE; - jabber_presence_send(js, TRUE); + * then now would be the time to declare ourselves connected. + */ + if (js->state != JABBER_STREAM_CONNECTED) jabber_stream_set_state(js, JABBER_STREAM_CONNECTED); - } } static void jabber_roster_update(JabberStream *js, const char *name, @@ -342,7 +339,8 @@ char *my_bare_jid; const char *name; - if(!js->roster_parsed) + /* If we haven't received the roster yet, ignore any adds */ + if (js->state != JABBER_STREAM_CONNECTED) return; name = purple_buddy_get_name(buddy);