/soc/2013/ankitkv/gobjectification: 88ae47a7d595: Updated protoc...

Ankit Vani a at nevitus.org
Wed Jun 26 16:01:49 EDT 2013


Changeset: 88ae47a7d595386f1a1a33b1da20b74327f3d5ac
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-06-27 01:26 +0530
Branch:	 soc.2013.gobjectification
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/88ae47a7d595

Description:

Updated protocols for the API changes

diffstat:

 libpurple/protocols/irc/msgs.c        |  18 ++++++++++--------
 libpurple/protocols/jabber/chat.c     |   2 +-
 libpurple/protocols/jabber/presence.c |   2 +-
 libpurple/protocols/novell/novell.c   |   2 +-
 libpurple/protocols/silc/ops.c        |   2 +-
 libpurple/protocols/yahoo/libymsg.c   |   2 +-
 libpurple/protocols/yahoo/yahoochat.c |   8 ++++----
 libpurple/protocols/zephyr/zephyr.c   |   2 +-
 8 files changed, 20 insertions(+), 18 deletions(-)

diffs (189 lines):

diff --git a/libpurple/protocols/irc/msgs.c b/libpurple/protocols/irc/msgs.c
--- a/libpurple/protocols/irc/msgs.c
+++ b/libpurple/protocols/irc/msgs.c
@@ -76,7 +76,7 @@ static void irc_chat_remove_buddy(Purple
 	message = g_strdup_printf("quit: %s", stripped);
 	g_free(stripped);
 
-	if (purple_chat_conversation_find_user(chat, data[0]))
+	if (purple_chat_conversation_has_user(chat, data[0]))
 		purple_chat_conversation_remove_user(chat, data[0], message);
 
 	g_free(message);
@@ -518,7 +518,7 @@ void irc_msg_who(struct irc_conn *irc, c
 		keys = g_list_prepend(keys, "realname");
 		values = g_list_prepend(values, realname);
 		
-		purple_chat_conversation_buddy_set_attributes(chat, cb, keys, values);
+		purple_chat_conversation_buddy_set_attributes(cb, chat, keys, values);
 		
 		g_list_free(keys);
 		g_list_free(values);
@@ -533,9 +533,9 @@ void irc_msg_who(struct irc_conn *irc, c
 		 * like it's more likely to be confusing than not.
 		 * Comments? */
 		if (args[6][0] == 'G' && !(flags & PURPLE_CHAT_CONVERSATION_BUDDY_AWAY)) {
-			purple_chat_conversation_user_set_flags(chat, purple_chat_conversation_buddy_get_name(cb), flags | PURPLE_CHAT_CONVERSATION_BUDDY_AWAY);
+			purple_chat_conversation_buddy_set_flags(cb, flags | PURPLE_CHAT_CONVERSATION_BUDDY_AWAY);
 		} else if(args[6][0] == 'H' && (flags & PURPLE_CHAT_CONVERSATION_BUDDY_AWAY)) {
-			purple_chat_conversation_user_set_flags(chat, purple_chat_conversation_buddy_get_name(cb), flags & ~PURPLE_CHAT_CONVERSATION_BUDDY_AWAY);
+			purple_chat_conversation_buddy_set_flags(cb, flags & ~PURPLE_CHAT_CONVERSATION_BUDDY_AWAY);
 		}
 	}
 }
@@ -1019,7 +1019,7 @@ void irc_msg_join(struct irc_conn *irc, 
 	cb = purple_chat_conversation_find_buddy(chat, nick);
 	
 	if (cb) {
-		purple_chat_conversation_buddy_set_attribute(chat, cb, "userhost", userhost);		
+		purple_chat_conversation_buddy_set_attribute(cb, chat, "userhost", userhost);		
 	}
 	
 	if ((ib = g_hash_table_lookup(irc->buddies, nick)) != NULL) {
@@ -1082,6 +1082,7 @@ void irc_msg_mode(struct irc_conn *irc, 
 		g_free(escaped);
 		g_free(buf);
 		if(args[2]) {
+			PurpleChatConversationBuddy *cb;
 			PurpleChatConversationBuddyFlags newflag, flags;
 			char *mcur, *cur, *end, *user;
 			gboolean add = FALSE;
@@ -1097,7 +1098,8 @@ void irc_msg_mode(struct irc_conn *irc, 
 				if (!end)
 					end = cur + strlen(cur);
 				user = g_strndup(cur, end - cur);
-				flags = purple_chat_conversation_user_get_flags(chat, user);
+				cb = purple_chat_conversation_find_buddy(chat, user);
+				flags = purple_chat_conversation_buddy_get_flags(cb);
 				newflag = PURPLE_CHAT_CONVERSATION_BUDDY_NONE;
 				if (*mcur == 'o')
 					newflag = PURPLE_CHAT_CONVERSATION_BUDDY_OP;
@@ -1113,7 +1115,7 @@ void irc_msg_mode(struct irc_conn *irc, 
 						flags |= newflag;
 					else
 						flags &= ~newflag;
-					purple_chat_conversation_user_set_flags(chat, user, flags);
+					purple_chat_conversation_buddy_set_flags(cb, flags);
 				}
 				g_free(user);
 				cur = end;
@@ -1150,7 +1152,7 @@ void irc_msg_nick(struct irc_conn *irc, 
 	while (chats) {
 		PurpleChatConversation *chat = PURPLE_CHAT_CONVERSATION(chats->data);
 		/* This is ugly ... */
-		if (purple_chat_conversation_find_user(chat, nick))
+		if (purple_chat_conversation_has_user(chat, nick))
 			purple_chat_conversation_rename_user(chat, nick, args[0]);
 		chats = chats->next;
 	}
diff --git a/libpurple/protocols/jabber/chat.c b/libpurple/protocols/jabber/chat.c
--- a/libpurple/protocols/jabber/chat.c
+++ b/libpurple/protocols/jabber/chat.c
@@ -453,7 +453,7 @@ void jabber_chat_free(JabberChat *chat)
 
 gboolean jabber_chat_find_buddy(PurpleChatConversation *conv, const char *name)
 {
-	return purple_chat_conversation_find_user(conv, name);
+	return purple_chat_conversation_has_user(conv, name);
 }
 
 char *jabber_chat_buddy_real_name(PurpleConnection *gc, int id, const char *who)
diff --git a/libpurple/protocols/jabber/presence.c b/libpurple/protocols/jabber/presence.c
--- a/libpurple/protocols/jabber/presence.c
+++ b/libpurple/protocols/jabber/presence.c
@@ -640,7 +640,7 @@ handle_presence_chat(JabberStream *js, J
 			purple_chat_conversation_add_user(chat->conv, presence->jid_from->resource,
 					jid, flags, chat->joined > 0 && ((!presence->delayed) || (presence->sent > chat->joined)));
 		else
-			purple_chat_conversation_user_set_flags(chat->conv, presence->jid_from->resource,
+			purple_chat_conversation_buddy_set_flags(purple_chat_conversation_find_buddy(chat->conv, presence->jid_from->resource),
 					flags);
 
 		if (is_our_resource && chat->joined == 0)
diff --git a/libpurple/protocols/novell/novell.c b/libpurple/protocols/novell/novell.c
--- a/libpurple/protocols/novell/novell.c
+++ b/libpurple/protocols/novell/novell.c
@@ -1988,7 +1988,7 @@ static void
 			ur = nm_find_user_record(user, nm_event_get_source(event));
 			if (ur) {
 				name = nm_user_record_get_display_id(ur);
-				if (!purple_chat_conversation_find_user(chat, name)) {
+				if (!purple_chat_conversation_has_user(chat, name)) {
 					purple_chat_conversation_add_user(chat, name, NULL,
 											PURPLE_CHAT_CONVERSATION_BUDDY_NONE, TRUE);
 				}
diff --git a/libpurple/protocols/silc/ops.c b/libpurple/protocols/silc/ops.c
--- a/libpurple/protocols/silc/ops.c
+++ b/libpurple/protocols/silc/ops.c
@@ -605,7 +605,7 @@ silc_notify(SilcClient client, SilcClien
 								      chu->channel->channel_name, sg->account);
 			if (!convo)
 				continue;
-			if (purple_chat_conversation_find_user(PURPLE_CONV_CHAT(convo), client_entry->nickname))
+			if (purple_chat_conversation_has_user(PURPLE_CONV_CHAT(convo), client_entry->nickname))
 				purple_chat_conversation_rename_user(PURPLE_CONV_CHAT(convo),
 							     tmp, name);
 		}
diff --git a/libpurple/protocols/yahoo/libymsg.c b/libpurple/protocols/yahoo/libymsg.c
--- a/libpurple/protocols/yahoo/libymsg.c
+++ b/libpurple/protocols/yahoo/libymsg.c
@@ -5260,7 +5260,7 @@ gboolean yahoo_send_attention(PurpleConn
 
 	purple_debug_info("yahoo", "Sending <ding> on account %s to buddy %s.\n",
 			username, purple_conversation_get_name(PURPLE_CONVERSATION(im)));
-	purple_conversation_send_message(PURPLE_CONVERSATION(im), "<ding>", PURPLE_MESSAGE_INVISIBLE);
+	purple_conversation_send_with_flags(PURPLE_CONVERSATION(im), "<ding>", PURPLE_MESSAGE_INVISIBLE);
 
 	return TRUE;
 }
diff --git a/libpurple/protocols/yahoo/yahoochat.c b/libpurple/protocols/yahoo/yahoochat.c
--- a/libpurple/protocols/yahoo/yahoochat.c
+++ b/libpurple/protocols/yahoo/yahoochat.c
@@ -82,7 +82,7 @@ void yahoo_chat_add_users(PurpleChatConv
 	GList *i;
 
 	for (i = newusers; i; i = i->next) {
-		if (purple_chat_conversation_find_user(chat, i->data))
+		if (purple_chat_conversation_has_user(chat, i->data))
 			continue;
 		purple_chat_conversation_add_user(chat, i->data, NULL, PURPLE_CHAT_CONVERSATION_BUDDY_NONE, TRUE);
 	}
@@ -90,7 +90,7 @@ void yahoo_chat_add_users(PurpleChatConv
 
 void yahoo_chat_add_user(PurpleChatConversation *chat, const char *user, const char *reason)
 {
-	if (purple_chat_conversation_find_user(chat, user))
+	if (purple_chat_conversation_has_user(chat, user))
 		return;
 
 	purple_chat_conversation_add_user(chat, user, reason, PURPLE_CHAT_CONVERSATION_BUDDY_NONE, TRUE);
@@ -287,7 +287,7 @@ void yahoo_process_conference_logon(Purp
 		c = yahoo_find_conference(gc, room);
 		if (c)
 		{	/* Prevent duplicate users in the chat */
-			if( !purple_chat_conversation_find_user(c, who) )
+			if( !purple_chat_conversation_has_user(c, who) )
 				yahoo_chat_add_user(c, who, NULL);
 		}
 		g_free(room);
@@ -597,7 +597,7 @@ void yahoo_process_chat_join(PurpleConne
 				if (!purple_utf8_strcasecmp((char *)l->data, roomies->data)) {
 					purple_debug_info("yahoo", "Ignoring room member %s in room %s\n" , (char *)roomies->data, room ? room : "");
 					purple_chat_conversation_ignore(c,roomies->data);
-					ops->chat_update_user(c, roomies->data);
+					ops->chat_update_user(purple_chat_conversation_find_buddy(c, roomies->data));
 				}
 			}
 		}
diff --git a/libpurple/protocols/zephyr/zephyr.c b/libpurple/protocols/zephyr/zephyr.c
--- a/libpurple/protocols/zephyr/zephyr.c
+++ b/libpurple/protocols/zephyr/zephyr.c
@@ -901,7 +901,7 @@ static void handle_message(PurpleConnect
 #ifndef INET_ADDRSTRLEN
 #define INET_ADDRSTRLEN 16
 #endif
-			if (!purple_chat_conversation_find_user(gcc, stripped_sender)) {
+			if (!purple_chat_conversation_has_user(gcc, stripped_sender)) {
 				gchar ipaddr[INET_ADDRSTRLEN];
 #ifdef HAVE_INET_NTOP
 				inet_ntop(AF_INET, &notice.z_sender_addr.s_addr, ipaddr, sizeof(ipaddr));



More information about the Commits mailing list