[Pidgin] #10410: ui ops and blist-node-added signal not called for first group added

Pidgin trac at pidgin.im
Wed Sep 30 15:00:40 EDT 2009


#10410: ui ops and blist-node-added signal not called for first group added
-------------------------+--------------------------------------------------
Reporter:  jochendesmet  |        Type:  defect   
  Status:  new           |   Component:  libpurple
 Version:  2.6.2         |    Keywords:  blist    
-------------------------+--------------------------------------------------
 In purple_blist_add_group, the case where no other groups exist yet
 (purplebuddylist->root is NULL) is handled early in the function by
 setting purplebuddylist->root to the new group and adding the group to the
 groups_cashe.

 But after doing that the function returns immediately, meaning that
 ops->save_node and ops->update_node will not be called for the newly-
 inserted group, and the blist-node-added signal will not be emitted.

 This patch fixes it but is probably not the right fix because it
 duplicates too much code:

 {{{
 --- libpurple/blist.c   2009-09-05 17:12:04.000000000 -0400
 +++ libpurple/blist.c.new       2009-09-30 14:58:51.000000000 -0400
 @@ -2014,6 +2014,22 @@

                 key = g_utf8_collate_key(group->name, -1);
                 g_hash_table_insert(groups_cache, key, group);
 +
 +               if (ops && ops->save_node) {
 +                       ops->save_node(gnode);
 +                       for (node = gnode->child; node; node = node->next)
 +                               ops->save_node(node);
 +               }
 +
 +               if (ops && ops->update) {
 +                       ops->update(purplebuddylist, gnode);
 +                       for (node = gnode->child; node; node = node->next)
 +                               ops->update(purplebuddylist, node);
 +               }
 +
 +               purple_signal_emit(purple_blist_get_handle(), "blist-node-
 added",
 +                               gnode);
 +
                 return;
         }
 }}}

-- 
Ticket URL: <http://developer.pidgin.im/ticket/10410>
Pidgin <http://pidgin.im>
Pidgin


More information about the Tracker mailing list