pidgin.next.minor: c6c01e07: Use purple_buddy_get_protocol_data() and...
rlaager at pidgin.im
rlaager at pidgin.im
Thu Oct 30 18:56:07 EDT 2008
-----------------------------------------------------------------
Revision: c6c01e07ada3a8808dad3309e7c8a6af938c0b1d
Ancestor: b20668b7f9977bd4d0096faface181965decd8e2
Author: rlaager at pidgin.im
Date: 2008-10-30T20:08:29
Branch: im.pidgin.pidgin.next.minor
URL: http://d.pidgin.im/viewmtn/revision/info/c6c01e07ada3a8808dad3309e7c8a6af938c0b1d
Modified files:
libpurple/protocols/bonjour/bonjour.c
libpurple/protocols/bonjour/buddy.c
ChangeLog:
Use purple_buddy_get_protocol_data() and purple_buddy_set_protocol_data()
in the Bonjour prpl. It's still not fully updated to compile.
-------------- next part --------------
============================================================
--- libpurple/protocols/bonjour/bonjour.c 8c4efa99065cadfeb781b41b9cea3dad06e0e58d
+++ libpurple/protocols/bonjour/bonjour.c c7220a1af0ff3a05ef6c4880079792617b950b41
@@ -261,9 +261,10 @@ static void bonjour_remove_buddy(PurpleC
static void bonjour_remove_buddy(PurpleConnection *pc, PurpleBuddy *buddy, PurpleGroup *group) {
- if (buddy->proto_data) {
- bonjour_buddy_delete(buddy->proto_data);
- buddy->proto_data = NULL;
+ BonjourBuddy *bb = purple_buddy_get_protocol_data(buddy);
+ if (bb) {
+ bonjour_buddy_delete(bb);
+ purple_buddy_set_protocol_data(buddy, NULL);
}
}
@@ -303,7 +304,7 @@ bonjour_convo_closed(PurpleConnection *c
PurpleBuddy *buddy = purple_find_buddy(connection->account, who);
BonjourBuddy *bb;
- if (buddy == NULL || buddy->proto_data == NULL)
+ if (buddy == NULL || (bb = purple_buddy_get_protocol_data(buddy)) == NULL)
{
/*
* This buddy is not in our buddy list, and therefore does not really
@@ -312,7 +313,6 @@ bonjour_convo_closed(PurpleConnection *c
return;
}
- bb = buddy->proto_data;
bonjour_jabber_close_conversation(bb->conversation);
bb->conversation = NULL;
}
@@ -351,7 +351,7 @@ bonjour_tooltip_text(PurpleBuddy *buddy,
{
PurplePresence *presence;
PurpleStatus *status;
- BonjourBuddy *bb = buddy->proto_data;
+ BonjourBuddy *bb = purple_buddy_get_protocol_data(buddy);
const char *status_description;
const char *message;
@@ -417,8 +417,7 @@ bonjour_can_receive_file(PurpleConnectio
{
PurpleBuddy *buddy = purple_find_buddy(connection->account, who);
- return (buddy != NULL && buddy->proto_data != NULL);
-
+ return (buddy != NULL && purple_buddy_get_protocol_data(buddy) != NULL);
}
static gboolean
============================================================
--- libpurple/protocols/bonjour/buddy.c 90aa957aac1ab51f4184dc610cad9605a595d86d
+++ libpurple/protocols/bonjour/buddy.c 8d958bcb78dec7cc2c31dd56e4318b9c7dcd5a61
@@ -157,7 +157,7 @@ bonjour_buddy_add_to_purple(BonjourBuddy
purple_blist_add_buddy(buddy, NULL, group, NULL);
}
- buddy->proto_data = bonjour_buddy;
+ purple_buddy_set_protocol_data(buddy, bonjour_buddy);
name = purple_buddy_get_name(buddy);
/* Create the alias for the buddy using the first and the last name */
@@ -210,8 +210,8 @@ void bonjour_buddy_signed_off(PurpleBudd
if (PURPLE_BLIST_NODE_SHOULD_SAVE(pb)) {
purple_prpl_got_user_status(purple_buddy_get_account(pb),
purple_buddy_get_name(pb), "offline", NULL);
- bonjour_buddy_delete(pb->proto_data);
- pb->proto_data = NULL;
+ bonjour_buddy_delete(purple_buddy_get_protocol_data(pb));
+ purple_buddy_set_protocol_data(pb, NULL);
} else {
purple_account_remove_buddy(purple_buddy_get_account(pb), pb, NULL);
purple_blist_remove_buddy(pb);
More information about the Commits
mailing list