[Pidgin] #5753: Bonjour buddies saveable

Pidgin trac at pidgin.im
Thu May 8 23:54:52 EDT 2008


#5753: Bonjour buddies saveable
--------------------------+-------------------------------------------------
Reporter:  BigBrownChunx  |       Owner:  datallah
    Type:  patch          |      Status:  new     
Priority:  minor          |   Component:  Bonjour 
 Version:  2.4.1          |    Keywords:          
 Pending:  0              |  
--------------------------+-------------------------------------------------
 Bonjour buddies cannot be saved/made persistent in the buddy list, which
 can be frustrating when moving a buddy to inside a contact, only to have
 it jump outside when you/the buddy goes offline and back online again.
 This patch fixes that, so that buddies who are moved outside the Bonjour
 group become saved onto the buddy list.

 libpurple/protocols/bonjour/bonjour.c
 {{{
 66a67,69
 >               /* If the buddy isn't in the bonjour group, skip it */
 >               if (strcmp(((PurpleGroup*)gnode)->name,
 BONJOUR_GROUP_NAME) != 0)
 >                       continue;
 153,156d155
 <       /* Create a group for bonjour buddies */
 <       bonjour_group = purple_group_new(BONJOUR_GROUP_NAME);
 <       purple_blist_add_group(bonjour_group, NULL);
 <
 406a406,425
 > static void
 > bonjour_group_buddy(PurpleConnection *connection, const char *who, const
 char *old_group, const char *new_group)
 > {
 >       PurpleBlistNodeFlags oldflags;
 >       PurpleBuddy *buddy = purple_find_buddy(connection->account, who);
 >
 >       if (buddy == NULL)
 >               return;
 >
 >       oldflags = purple_blist_node_get_flags((PurpleBlistNode *)buddy);
 >
 >       /* If we're moving them out of the bonjour group, make them
 persistent */
 >       if (strcmp(new_group, BONJOUR_GROUP_NAME) == 0)
 >       {
 >               purple_blist_node_set_flags((PurpleBlistNode *)buddy,
 oldflags | PURPLE_BLIST_NODE_FLAG_NO_SAVE);
 >       } else {
 >               purple_blist_node_set_flags((PurpleBlistNode *)buddy,
 oldflags & !PURPLE_BLIST_NODE_FLAG_NO_SAVE);
 >       }
 > }
 >
 465c484
 <       NULL,                                                    /*
 group_buddy */
 ---
 >       bonjour_group_buddy,                                     /*
 group_buddy */
 }}}

 libpurple/protocols/bonjour/buddy.c
 {{{
 156d155
 <               buddy->proto_data = bonjour_buddy;
 160c159,161
 <
 ---
 >
 >       buddy->proto_data = bonjour_buddy;
 >
 }}}

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


More information about the Tracker mailing list