changeset 32238:1f68af4afe67

Use purple_conversation accessor methods.
author andrew.victor@mxit.com
date Sat, 01 Oct 2011 15:03:57 +0000
parents 3e2191125ad7
children 35c1739709df
files libpurple/plugins/statenotify.c libpurple/protocols/gg/gg.c libpurple/protocols/irc/irc.c libpurple/protocols/jabber/jabber.c libpurple/protocols/sametime/sametime.c libpurple/protocols/yahoo/libymsg.c libpurple/protocols/yahoo/yahoochat.c
diffstat 7 files changed, 14 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/plugins/statenotify.c	Sat Oct 01 13:49:37 2011 +0000
+++ b/libpurple/plugins/statenotify.c	Sat Oct 01 15:03:57 2011 +0000
@@ -30,7 +30,7 @@
 
 	if (conv == NULL)
 		return;
-	g_return_if_fail(conv->type == PURPLE_CONV_TYPE_IM);
+	g_return_if_fail(purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM);
 
 	/* Prevent duplicate notifications for buddies in multiple groups */
 	if (buddy != purple_find_buddy(account, buddy_name))
--- a/libpurple/protocols/gg/gg.c	Sat Oct 01 13:49:37 2011 +0000
+++ b/libpurple/protocols/gg/gg.c	Sat Oct 01 15:03:57 2011 +0000
@@ -2543,7 +2543,7 @@
 	for (l = info->chats; l != NULL; l = l->next) {
 		chat = l->data;
 
-		if (g_utf8_collate(chat->name, conv->name) == 0) {
+		if (g_utf8_collate(chat->name, purple_conversation_get_name(conv)) == 0) {
 			break;
 		}
 
--- a/libpurple/protocols/irc/irc.c	Sat Oct 01 13:49:37 2011 +0000
+++ b/libpurple/protocols/irc/irc.c	Sat Oct 01 15:03:57 2011 +0000
@@ -807,7 +807,7 @@
 	}
 #endif
 	purple_markup_html_to_xhtml(what, NULL, &tmp);
-	args[0] = convo->name;
+	args[0] = purple_conversation_get_name(convo);
 	args[1] = tmp;
 
 	irc_cmd_privmsg(irc, "msg", NULL, args);
--- a/libpurple/protocols/jabber/jabber.c	Sat Oct 01 13:49:37 2011 +0000
+++ b/libpurple/protocols/jabber/jabber.c	Sat Oct 01 15:03:57 2011 +0000
@@ -3163,13 +3163,14 @@
 static PurpleCmdRet jabber_cmd_buzz(PurpleConversation *conv,
 		const char *cmd, char **args, char **error, void *data)
 {
-	JabberStream *js = purple_connection_get_protocol_data(conv->account->gc);
+	PurpleAccount *account = purple_conversation_get_account(conv);
+	JabberStream *js = purple_connection_get_protocol_data(account->gc);
 	const gchar *who;
 	gchar *description;
 	PurpleBuddy *buddy;
 	const char *alias;
 	PurpleAttentionType *attn =
-		purple_get_attention_type_from_code(conv->account, 0);
+		purple_get_attention_type_from_code(account, 0);
 
 	if (!args || !args[0]) {
 		/* use the buddy from conversation, if it's a one-to-one conversation */
@@ -3182,7 +3183,7 @@
 		who = args[0];
 	}
 
-	buddy = purple_find_buddy(conv->account, who);
+	buddy = purple_find_buddy(account, who);
 	if (buddy != NULL)
 		alias = purple_buddy_get_contact_alias(buddy);
 	else
@@ -3574,7 +3575,8 @@
 jabber_cmd_mood(PurpleConversation *conv,
 		const char *cmd, char **args, char **error, void *data)
 {
-	JabberStream *js = purple_connection_get_protocol_data(conv->account->gc);
+	PurpleAccount *account = purple_conversation_get_account(conv);
+	JabberStream *js = purple_connection_get_protocol_data(account->gc);
 
 	if (js->pep) {
 		/* if no argument was given, unset mood */
--- a/libpurple/protocols/sametime/sametime.c	Sat Oct 01 13:49:37 2011 +0000
+++ b/libpurple/protocols/sametime/sametime.c	Sat Oct 01 15:03:57 2011 +0000
@@ -2480,12 +2480,12 @@
   text = g_strconcat(_("Unable to send message: "), tmp, NULL);
 
   gconv = convo_get_gconv(conv);
-  if(gconv && !purple_conv_present_error(idb->user, gconv->account, text)) {
+  if(gconv && !purple_conv_present_error(idb->user, purple_conversation_get_account(gconv), text)) {
 
     g_free(text);
     text = g_strdup_printf(_("Unable to send message to %s:"),
 			   (idb->user)? idb->user: "(unknown)");
-    purple_notify_error(purple_account_get_connection(gconv->account),
+    purple_notify_error(purple_account_get_connection(purple_conversation_get_account(gconv)),
 		      NULL, text, tmp);
   }
 
--- a/libpurple/protocols/yahoo/libymsg.c	Sat Oct 01 13:49:37 2011 +0000
+++ b/libpurple/protocols/yahoo/libymsg.c	Sat Oct 01 15:03:57 2011 +0000
@@ -5213,7 +5213,7 @@
 	if (*args && args[0])
 		return PURPLE_CMD_RET_FAILED;
 
-	purple_prpl_send_attention(account->gc, c->name, YAHOO_BUZZ);
+	purple_prpl_send_attention(account->gc, purple_conversation_get_name(c), YAHOO_BUZZ);
 
 	return PURPLE_CMD_RET_OK;
 }
@@ -5267,7 +5267,7 @@
 	g_return_val_if_fail(c != NULL, FALSE);
 
 	purple_debug_info("yahoo", "Sending <ding> on account %s to buddy %s.\n",
-			username, c->name);
+			username, purple_conversation_get_name(c));
 	purple_conv_im_send_with_flags(PURPLE_CONV_IM(c), "<ding>", PURPLE_MESSAGE_INVISIBLE);
 
 	return TRUE;
--- a/libpurple/protocols/yahoo/yahoochat.c	Sat Oct 01 13:49:37 2011 +0000
+++ b/libpurple/protocols/yahoo/yahoochat.c	Sat Oct 01 15:03:57 2011 +0000
@@ -1166,7 +1166,7 @@
 	PurpleConversation *c;
 
 	c = purple_find_chat(gc, id);
-	if (!c || !c->name)
+	if (!c || !purple_conversation_get_name(c))
 		return;
 
 	if (id != YAHOO_CHAT_ID) {