libpurple/protocols/jabber/roster.c

changeset 27278
b34a1cea4872
parent 27277
8a2ecbdd70e4
child 27280
55a39efcf7b8
equal deleted inserted replaced
27277:8a2ecbdd70e4 27278:b34a1cea4872
242 242
243 g_free(own_jid); 243 g_free(own_jid);
244 js->currently_parsing_roster_push = FALSE; 244 js->currently_parsing_roster_push = FALSE;
245 245
246 /* if we're just now parsing the roster for the first time, 246 /* if we're just now parsing the roster for the first time,
247 * then now would be the time to declare ourselves connected and 247 * then now would be the time to declare ourselves connected.
248 * send our initial presence */ 248 */
249 if(!js->roster_parsed) { 249 if (js->state != JABBER_STREAM_CONNECTED)
250 js->roster_parsed = TRUE;
251 jabber_presence_send(js, TRUE);
252 jabber_stream_set_state(js, JABBER_STREAM_CONNECTED); 250 jabber_stream_set_state(js, JABBER_STREAM_CONNECTED);
253 }
254 } 251 }
255 252
256 static void jabber_roster_update(JabberStream *js, const char *name, 253 static void jabber_roster_update(JabberStream *js, const char *name,
257 GSList *grps) 254 GSList *grps)
258 { 255 {
340 JabberBuddy *jb; 337 JabberBuddy *jb;
341 JabberBuddyResource *jbr; 338 JabberBuddyResource *jbr;
342 char *my_bare_jid; 339 char *my_bare_jid;
343 const char *name; 340 const char *name;
344 341
345 if(!js->roster_parsed) 342 /* If we haven't received the roster yet, ignore any adds */
343 if (js->state != JABBER_STREAM_CONNECTED)
346 return; 344 return;
347 345
348 name = purple_buddy_get_name(buddy); 346 name = purple_buddy_get_name(buddy);
349 if(!(who = jabber_get_bare_jid(name))) 347 if(!(who = jabber_get_bare_jid(name)))
350 return; 348 return;

mercurial