Mercurial > pidgin
comparison finch/gntconv.c @ 22212:6bb29f94862c
Add API so Finch doesn't need to touch the internals of PurpleBlistNode.
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Sat, 26 Jan 2008 20:32:26 +0000 |
parents | c38d72677c8a |
children | 16ff37f64e29 |
comparison
equal
deleted
inserted
replaced
22211:eddcf0f2da51 | 22212:6bb29f94862c |
---|---|
77 PurpleBlistNode *node = NULL; | 77 PurpleBlistNode *node = NULL; |
78 | 78 |
79 switch (purple_conversation_get_type(conv)) { | 79 switch (purple_conversation_get_type(conv)) { |
80 case PURPLE_CONV_TYPE_IM: | 80 case PURPLE_CONV_TYPE_IM: |
81 node = (PurpleBlistNode*)purple_find_buddy(conv->account, conv->name); | 81 node = (PurpleBlistNode*)purple_find_buddy(conv->account, conv->name); |
82 node = node ? node->parent : NULL; | 82 node = node ? purple_blist_node_get_parent(node) : NULL; |
83 break; | 83 break; |
84 case PURPLE_CONV_TYPE_CHAT: | 84 case PURPLE_CONV_TYPE_CHAT: |
85 node = (PurpleBlistNode*)purple_blist_find_chat(conv->account, conv->name); | 85 node = (PurpleBlistNode*)purple_blist_find_chat(conv->account, conv->name); |
86 break; | 86 break; |
87 default: | 87 default: |
234 PurpleConversation *ret = NULL; | 234 PurpleConversation *ret = NULL; |
235 | 235 |
236 if (!buddy) | 236 if (!buddy) |
237 return NULL; | 237 return NULL; |
238 | 238 |
239 for (node = ((PurpleBlistNode*)buddy)->parent->child; node; node = node->next) { | 239 for (node = purple_blist_node_get_first_child(purple_blist_node_get_parent((PurpleBlistNode*)buddy)); |
240 node; node = purple_blist_node_get_sibling_next(node)) { | |
240 if (node == (PurpleBlistNode*)buddy) | 241 if (node == (PurpleBlistNode*)buddy) |
241 continue; | 242 continue; |
242 if ((ret = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, | 243 if ((ret = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, |
243 ((PurpleBuddy*)node)->name, ((PurpleBuddy*)node)->account)) != NULL) | 244 ((PurpleBuddy*)node)->name, ((PurpleBuddy*)node)->account)) != NULL) |
244 break; | 245 break; |
474 sub = gnt_menu_new(GNT_MENU_POPUP); | 475 sub = gnt_menu_new(GNT_MENU_POPUP); |
475 gnt_menuitem_set_submenu(item, GNT_MENU(sub)); | 476 gnt_menuitem_set_submenu(item, GNT_MENU(sub)); |
476 | 477 |
477 for (; buds; buds = g_slist_delete_link(buds, buds)) { | 478 for (; buds; buds = g_slist_delete_link(buds, buds)) { |
478 PurpleBlistNode *node = (PurpleBlistNode *)purple_buddy_get_contact((PurpleBuddy *)buds->data); | 479 PurpleBlistNode *node = (PurpleBlistNode *)purple_buddy_get_contact((PurpleBuddy *)buds->data); |
479 for (node = node->child; node != NULL; node = node->next) { | 480 for (node = purple_blist_node_get_first_child(node); node != NULL; |
481 node = purple_blist_node_get_sibling_next(node)) { | |
480 PurpleBuddy *buddy = (PurpleBuddy *)node; | 482 PurpleBuddy *buddy = (PurpleBuddy *)node; |
481 PurpleAccount *account = purple_buddy_get_account(buddy); | 483 PurpleAccount *account = purple_buddy_get_account(buddy); |
482 if (purple_account_is_connected(account)) { | 484 if (purple_account_is_connected(account)) { |
483 /* Use the PurplePresence to get unique buddies. */ | 485 /* Use the PurplePresence to get unique buddies. */ |
484 PurplePresence *presence = purple_buddy_get_presence(buddy); | 486 PurplePresence *presence = purple_buddy_get_presence(buddy); |