pidgin: 79787dba: Use purple_conv_chat_get_nick() rather t...

andrew.victor at mxit.com andrew.victor at mxit.com
Sat Oct 1 09:55:53 EDT 2011


----------------------------------------------------------------------
Revision: 79787dbaaadd121183a9725c604e0a64efbd5404
Parent:   695363099d3ef41664329bad572823a3efd35820
Author:   andrew.victor at mxit.com
Date:     10/01/11 07:02:15
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/79787dbaaadd121183a9725c604e0a64efbd5404

Changelog: 

Use purple_conv_chat_get_nick() rather than accessing chat->nick directly.


Changes against parent 695363099d3ef41664329bad572823a3efd35820

  patched  finch/gntsound.c
  patched  finch/plugins/gntgf.c
  patched  pidgin/gtkconv.c
  patched  pidgin/gtksound.c

-------------- next part --------------
============================================================
--- pidgin/gtkconv.c	feb759f47ecbf46800ff4860d6c7b94930b67994
+++ pidgin/gtkconv.c	101988e95423434c7feb6b0dfe2612e38ec43f48
@@ -1657,7 +1657,7 @@ create_chat_menu(PurpleConversation *con
 	if (menu)
 		gtk_widget_destroy(menu);
 
-	if (!strcmp(chat->nick, purple_normalize(conv->account, who)))
+	if (!strcmp(purple_conv_chat_get_nick(chat), purple_normalize(conv->account, who)))
 		is_me = TRUE;
 
 	menu = gtk_menu_new();
@@ -4070,7 +4070,7 @@ add_chat_buddy_common(PurpleConversation
 
 	stock = get_chat_buddy_status_icon(chat, name, flags);
 
-	if (!strcmp(chat->nick, purple_normalize(conv->account, old_name != NULL ? old_name : name)))
+	if (!strcmp(purple_conv_chat_get_nick(chat), purple_normalize(conv->account, old_name != NULL ? old_name : name)))
 		is_me = TRUE;
 
 	is_buddy = cb->buddy;
@@ -4474,7 +4474,7 @@ update_chat_alias(PurpleBuddy *buddy, Pu
 			char *alias_key = NULL;
 			PurpleBuddy *buddy2;
 
-			if (strcmp(chat->nick, purple_normalize(conv->account, name))) {
+			if (strcmp(purple_conv_chat_get_nick(chat), purple_normalize(conv->account, name))) {
 				/* This user is not me, so look into updating the alias. */
 
 				if ((buddy2 = purple_find_buddy(conv->account, name)) != NULL) {
============================================================
--- pidgin/gtksound.c	b8de9a25c429dd4eb3fedbe500d4d86b004409b3
+++ pidgin/gtksound.c	d8f11dd93dd2ca281fb2f6263ec8e4aabfd49d76
@@ -96,7 +96,7 @@ chat_nick_matches_name(PurpleConversatio
 	if (chat==NULL)
 		return ret;
 
-	nick = g_strdup(purple_normalize(conv->account, chat->nick));
+	nick = g_strdup(purple_normalize(conv->account, purple_conv_chat_get_nick(chat)));
 	name = g_strdup(purple_normalize(conv->account, aname));
 
 	if (g_utf8_collate(nick, name) == 0)
@@ -212,7 +212,7 @@ chat_msg_received_cb(PurpleAccount *acco
 	if (chat_nick_matches_name(conv, sender))
 		return;
 
-	if (flags & PURPLE_MESSAGE_NICK || purple_utf8_has_word(message, chat->nick))
+	if (flags & PURPLE_MESSAGE_NICK || purple_utf8_has_word(message, purple_conv_chat_get_nick(chat)))
 		/* This isn't quite right; if you have the PURPLE_SOUND_CHAT_NICK event disabled
 		 * and the PURPLE_SOUND_CHAT_SAY event enabled, you won't get a sound at all */
 		play_conv_event(conv, PURPLE_SOUND_CHAT_NICK);
============================================================
--- finch/plugins/gntgf.c	f14b3bb901aa57f2ddc811e2174aa3c632bda0c4
+++ finch/plugins/gntgf.c	ae6752d2b92b048f58f7e075f196bf0510887427
@@ -256,7 +256,7 @@ received_chat_msg(PurpleAccount *account
 	if (flags & PURPLE_MESSAGE_WHISPER)
 		return;
 
-	nick = PURPLE_CONV_CHAT(conv)->nick;
+	nick = purple_conv_chat_get_nick(PURPLE_CONV_CHAT(conv));
 
 	if (g_utf8_collate(sender, nick) == 0)
 		return;
============================================================
--- finch/gntsound.c	3d4aef18aa8413deea3a48c86ecbe6997ee63dce
+++ finch/gntsound.c	9bc4a9c5977622aef9c1a24215cdf71610d9a849
@@ -150,7 +150,7 @@ chat_nick_matches_name(PurpleConversatio
 		return ret;
 
 	account = purple_conversation_get_account(conv);
-	nick = g_strdup(purple_normalize(account, chat->nick));
+	nick = g_strdup(purple_normalize(account, purple_conv_chat_get_nick(chat)));
 	name = g_strdup(purple_normalize(account, aname));
 
 	if (g_utf8_collate(nick, name) == 0)
@@ -268,7 +268,7 @@ chat_msg_received_cb(PurpleAccount *acco
 	if (chat_nick_matches_name(conv, sender))
 		return;
 
-	if (flags & PURPLE_MESSAGE_NICK || purple_utf8_has_word(message, chat->nick))
+	if (flags & PURPLE_MESSAGE_NICK || purple_utf8_has_word(message, purple_conv_chat_get_nick(chat)))
 		play_conv_event(conv, PURPLE_SOUND_CHAT_NICK);
 	else
 		play_conv_event(conv, event);


More information about the Commits mailing list