| 94 |
94 |
| 95 static void remove_purple_buddies(JabberStream *js, const char *jid) |
95 static void remove_purple_buddies(JabberStream *js, const char *jid) |
| 96 { |
96 { |
| 97 GSList *buddies, *l; |
97 GSList *buddies, *l; |
| 98 |
98 |
| 99 buddies = purple_find_buddies(js->gc->account, jid); |
99 buddies = purple_find_buddies(purple_connection_get_account(js->gc), jid); |
| 100 |
100 |
| 101 for(l = buddies; l; l = l->next) |
101 for(l = buddies; l; l = l->next) |
| 102 purple_blist_remove_buddy(l->data); |
102 purple_blist_remove_buddy(l->data); |
| 103 |
103 |
| 104 g_slist_free(buddies); |
104 g_slist_free(buddies); |
| 108 const char *alias, GSList *groups) |
108 const char *alias, GSList *groups) |
| 109 { |
109 { |
| 110 GSList *buddies, *l; |
110 GSList *buddies, *l; |
| 111 PurpleAccount *account = purple_connection_get_account(js->gc); |
111 PurpleAccount *account = purple_connection_get_account(js->gc); |
| 112 |
112 |
| 113 buddies = purple_find_buddies(js->gc->account, jid); |
113 buddies = purple_find_buddies(purple_connection_get_account(js->gc), jid); |
| 114 |
114 |
| 115 if(!groups) { |
115 if(!groups) { |
| 116 if(!buddies) |
116 if(!buddies) |
| 117 groups = g_slist_append(groups, g_strdup(_("Buddies"))); |
117 groups = g_slist_append(groups, g_strdup(_("Buddies"))); |
| 118 else { |
118 else { |
| 302 const char *balias; |
302 const char *balias; |
| 303 |
303 |
| 304 if (js->currently_parsing_roster_push) |
304 if (js->currently_parsing_roster_push) |
| 305 return; |
305 return; |
| 306 |
306 |
| 307 if(!(b = purple_find_buddy(js->gc->account, name))) |
307 if(!(b = purple_find_buddy(purple_connection_get_account(js->gc), name))) |
| 308 return; |
308 return; |
| 309 |
309 |
| 310 if (groups) { |
310 if (groups) { |
| 311 char *tmp = roster_groups_join(groups); |
311 char *tmp = roster_groups_join(groups); |
| 312 |
312 |
| 313 purple_debug_info("jabber", "jabber_roster_update(%s): [Source: " |
313 purple_debug_info("jabber", "jabber_roster_update(%s): [Source: " |
| 314 "groups]: groups: %s\n", name, tmp); |
314 "groups]: groups: %s\n", name, tmp); |
| 315 g_free(tmp); |
315 g_free(tmp); |
| 316 } else { |
316 } else { |
| 317 GSList *buddies = purple_find_buddies(js->gc->account, name); |
317 GSList *buddies = purple_find_buddies(purple_connection_get_account(js->gc), name); |
| 318 char *tmp; |
318 char *tmp; |
| 319 |
319 |
| 320 if(!buddies) |
320 if(!buddies) |
| 321 return; |
321 return; |
| 322 while(buddies) { |
322 while(buddies) { |
| 411 if (jb == js->user_jb) { |
411 if (jb == js->user_jb) { |
| 412 jabber_presence_fake_to_self(js, NULL); |
412 jabber_presence_fake_to_self(js, NULL); |
| 413 } else if(!jb || !(jb->subscription & JABBER_SUB_TO)) { |
413 } else if(!jb || !(jb->subscription & JABBER_SUB_TO)) { |
| 414 jabber_presence_subscription_set(js, who, "subscribe"); |
414 jabber_presence_subscription_set(js, who, "subscribe"); |
| 415 } else if((jbr =jabber_buddy_find_resource(jb, NULL))) { |
415 } else if((jbr =jabber_buddy_find_resource(jb, NULL))) { |
| 416 purple_prpl_got_user_status(gc->account, who, |
416 purple_prpl_got_user_status(purple_connection_get_account(gc), who, |
| 417 jabber_buddy_state_get_status_id(jbr->state), |
417 jabber_buddy_state_get_status_id(jbr->state), |
| 418 "priority", jbr->priority, jbr->status ? "message" : NULL, jbr->status, NULL); |
418 "priority", jbr->priority, jbr->status ? "message" : NULL, jbr->status, NULL); |
| 419 } |
419 } |
| 420 |
420 |
| 421 g_free(who); |
421 g_free(who); |
| 422 } |
422 } |
| 423 |
423 |
| 424 void jabber_roster_alias_change(PurpleConnection *gc, const char *name, const char *alias) |
424 void jabber_roster_alias_change(PurpleConnection *gc, const char *name, const char *alias) |
| 425 { |
425 { |
| 426 PurpleBuddy *b = purple_find_buddy(gc->account, name); |
426 PurpleBuddy *b = purple_find_buddy(purple_connection_get_account(gc), name); |
| 427 |
427 |
| 428 if(b != NULL) { |
428 if(b != NULL) { |
| 429 purple_blist_alias_buddy(b, alias); |
429 purple_blist_alias_buddy(b, alias); |
| 430 |
430 |
| 431 purple_debug_info("jabber", "jabber_roster_alias_change(): Aliased %s to %s\n", |
431 purple_debug_info("jabber", "jabber_roster_alias_change(): Aliased %s to %s\n", |
| 444 const char *gname; |
444 const char *gname; |
| 445 |
445 |
| 446 if(!old_group || !new_group || !strcmp(old_group, new_group)) |
446 if(!old_group || !new_group || !strcmp(old_group, new_group)) |
| 447 return; |
447 return; |
| 448 |
448 |
| 449 buddies = purple_find_buddies(gc->account, name); |
449 buddies = purple_find_buddies(purple_connection_get_account(gc), name); |
| 450 while(buddies) { |
450 while(buddies) { |
| 451 b = buddies->data; |
451 b = buddies->data; |
| 452 g = purple_buddy_get_group(b); |
452 g = purple_buddy_get_group(b); |
| 453 gname = purple_group_get_name(g); |
453 gname = purple_group_get_name(g); |
| 454 if(!strcmp(gname, old_group)) |
454 if(!strcmp(gname, old_group)) |