comparison libpurple/protocols/yahoo/libymsg.c @ 30213:597840eccfa7

merge of '0627a49f54e3d5317e6a8dd97956ee2abfa32f9d' and '8bc0a157fd0b23d8e7b6dc9b581fc636e9a0f258'
author Paul Aurich <paul@darkrain42.org>
date Fri, 18 Jun 2010 20:14:06 +0000
parents 490707649f29
children 3ae0814ae727
comparison
equal deleted inserted replaced
30212:51d5ec7b1699 30213:597840eccfa7
399 static void yahoo_do_group_check(PurpleAccount *account, GHashTable *ht, const char *name, const char *group) 399 static void yahoo_do_group_check(PurpleAccount *account, GHashTable *ht, const char *name, const char *group)
400 { 400 {
401 PurpleBuddy *b; 401 PurpleBuddy *b;
402 PurpleGroup *g; 402 PurpleGroup *g;
403 GSList *list, *i; 403 GSList *list, *i;
404 gboolean onlist = 0; 404 gboolean onlist = FALSE;
405 char *oname = NULL; 405 char *oname = NULL;
406 char **oname_p = &oname; 406
407 GSList **list_p = &list; 407 if (g_hash_table_lookup_extended(ht, purple_normalize(account, name), (gpointer *)&oname, (gpointer *)&list))
408 408 g_hash_table_steal(ht, name);
409 if (!g_hash_table_lookup_extended(ht, purple_normalize(account, name), (gpointer *) oname_p, (gpointer *) list_p)) 409 else
410 list = purple_find_buddies(account, name); 410 list = purple_find_buddies(account, name);
411 else
412 g_hash_table_steal(ht, name);
413 411
414 for (i = list; i; i = i->next) { 412 for (i = list; i; i = i->next) {
415 b = i->data; 413 b = i->data;
416 g = purple_buddy_get_group(b); 414 g = purple_buddy_get_group(b);
417 if (!purple_utf8_strcasecmp(group, purple_group_get_name(g))) { 415 if (!purple_utf8_strcasecmp(group, purple_group_get_name(g))) {
418 purple_debug_misc("yahoo", 416 purple_debug_misc("yahoo",
419 "Oh good, %s is in the right group (%s).\n", name, group); 417 "Oh good, %s is in the right group (%s).\n", name, group);
420 list = g_slist_delete_link(list, i); 418 list = g_slist_delete_link(list, i);
421 onlist = 1; 419 onlist = TRUE;
422 break; 420 break;
423 } 421 }
424 } 422 }
425 423
426 if (!onlist) { 424 if (!onlist) {
436 434
437 if (list) { 435 if (list) {
438 if (!oname) 436 if (!oname)
439 oname = g_strdup(purple_normalize(account, name)); 437 oname = g_strdup(purple_normalize(account, name));
440 g_hash_table_insert(ht, oname, list); 438 g_hash_table_insert(ht, oname, list);
441 } else if (oname) 439 } else
442 g_free(oname); 440 g_free(oname);
443 } 441 }
444 442
445 static void yahoo_do_group_cleanup(gpointer key, gpointer value, gpointer user_data) 443 static void yahoo_do_group_cleanup(gpointer key, gpointer value, gpointer user_data)
446 { 444 {
841 break; 839 break;
842 case YAHOO_FEDERATION_NONE: 840 case YAHOO_FEDERATION_NONE:
843 default: 841 default:
844 break; 842 break;
845 } 843 }
846 844
847 if (*stat == '1') 845 if (*stat == '1')
848 serv_got_typing(gc, fed_from, 0, PURPLE_TYPING); 846 serv_got_typing(gc, fed_from, 0, PURPLE_TYPING);
849 else 847 else
850 serv_got_typing_stopped(gc, fed_from); 848 serv_got_typing_stopped(gc, fed_from);
851 849
852 if (fed_from != from) 850 if (fed_from != from)
853 g_free(fed_from); 851 g_free(fed_from);
854 852
855 } else if (!g_ascii_strncasecmp(msg, "GAME", strlen("GAME"))) { 853 } else if (!g_ascii_strncasecmp(msg, "GAME", strlen("GAME"))) {
856 PurpleBuddy *bud = purple_find_buddy(account, from); 854 PurpleBuddy *bud = purple_find_buddy(account, from);