summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Laager <rlaager@pidgin.im>2008-10-30 20:02:30 +0000
committerRichard Laager <rlaager@pidgin.im>2008-10-30 20:02:30 +0000
commite1a097cbc494eeda4e595a41f2b0339905f4373a (patch)
treee2b4784847539429b1180c0eddc9de828541cf69
parentb4002ef76d7d987a6b1835911c6a0275221a9821 (diff)
downloadpidgin-e1a097cbc494eeda4e595a41f2b0339905f4373a.tar.gz
More Bonjour struct hiding fixes.
-rw-r--r--libpurple/protocols/bonjour/buddy.c15
-rw-r--r--libpurple/protocols/bonjour/jabber.c4
2 files changed, 10 insertions, 9 deletions
diff --git a/libpurple/protocols/bonjour/buddy.c b/libpurple/protocols/bonjour/buddy.c
index 3533589132..a4f709bb01 100644
--- a/libpurple/protocols/bonjour/buddy.c
+++ b/libpurple/protocols/bonjour/buddy.c
@@ -127,7 +127,7 @@ bonjour_buddy_add_to_purple(BonjourBuddy *bonjour_buddy, PurpleBuddy *buddy)
{
PurpleGroup *group;
PurpleAccount *account = bonjour_buddy->account;
- const char *status_id, *old_hash, *new_hash;
+ const char *status_id, *old_hash, *new_hash, *name;
/* Translate between the Bonjour status and the Purple status */
if (bonjour_buddy->status != NULL && g_ascii_strcasecmp("dnd", bonjour_buddy->status) == 0)
@@ -158,10 +158,11 @@ bonjour_buddy_add_to_purple(BonjourBuddy *bonjour_buddy, PurpleBuddy *buddy)
}
buddy->proto_data = bonjour_buddy;
+ name = purple_buddy_get_name(buddy);
/* Create the alias for the buddy using the first and the last name */
if (bonjour_buddy->nick)
- serv_got_alias(purple_account_get_connection(account), buddy->name, bonjour_buddy->nick);
+ serv_got_alias(purple_account_get_connection(account), name, bonjour_buddy->nick);
else {
gchar *alias = NULL;
const char *first, *last;
@@ -172,18 +173,18 @@ bonjour_buddy_add_to_purple(BonjourBuddy *bonjour_buddy, PurpleBuddy *buddy)
(first && *first ? first : ""),
(first && *first && last && *last ? " " : ""),
(last && *last ? last : ""));
- serv_got_alias(purple_account_get_connection(account), buddy->name, alias);
+ serv_got_alias(purple_account_get_connection(account), name, alias);
g_free(alias);
}
/* Set the user's status */
if (bonjour_buddy->msg != NULL)
- purple_prpl_got_user_status(account, buddy->name, status_id,
+ purple_prpl_got_user_status(account, name, status_id,
"message", bonjour_buddy->msg, NULL);
else
- purple_prpl_got_user_status(account, buddy->name, status_id, NULL);
+ purple_prpl_got_user_status(account, name, status_id, NULL);
- purple_prpl_got_user_idle(account, buddy->name, FALSE, 0);
+ purple_prpl_got_user_idle(account, name, FALSE, 0);
/* TODO: Because we don't save Bonjour buddies in blist.xml,
* we will always have to look up the buddy icon at login time.
@@ -198,7 +199,7 @@ bonjour_buddy_add_to_purple(BonjourBuddy *bonjour_buddy, PurpleBuddy *buddy)
* as what we looked up. */
bonjour_dns_sd_retrieve_buddy_icon(bonjour_buddy);
} else if (!new_hash)
- purple_buddy_icons_set_for_user(account, buddy->name, NULL, 0, NULL);
+ purple_buddy_icons_set_for_user(account, name, NULL, 0, NULL);
}
/**
diff --git a/libpurple/protocols/bonjour/jabber.c b/libpurple/protocols/bonjour/jabber.c
index 769aed0b53..c0430de3ab 100644
--- a/libpurple/protocols/bonjour/jabber.c
+++ b/libpurple/protocols/bonjour/jabber.c
@@ -142,7 +142,7 @@ static void
_jabber_parse_and_write_message_to_ui(xmlnode *message_node, PurpleBuddy *pb)
{
xmlnode *body_node, *html_node, *events_node;
- PurpleConnection *gc = pb->account->gc;
+ PurpleConnection *gc = purple_account_get_connection(purple_buddy_get_account(pb));
gchar *body = NULL;
gboolean composing_event = FALSE;
@@ -225,7 +225,7 @@ _jabber_parse_and_write_message_to_ui(xmlnode *message_node, PurpleBuddy *pb)
}
/* Send the message to the UI */
- serv_got_im(gc, pb->name, body, 0, time(NULL));
+ serv_got_im(gc, purple_buddy_get_name(pb), body, 0, time(NULL));
g_free(body);
}