/soc/2013/ankitkv/gobjectification: d7350d876fda: libpurple: Don...

Ankit Vani a at nevitus.org
Sun Nov 17 13:33:07 EST 2013


Changeset: d7350d876fda5f955b4d5b2e77ba728e729621fb
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-11-17 23:49 +0530
Branch:	 soc.2013.gobjectification
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/d7350d876fda

Description:

libpurple: Don't assume a conversation is always an IM or a chat

diffstat:

 libpurple/protocols/jabber/message.c    |  4 +++-
 libpurple/protocols/msn/switchboard.c   |  2 +-
 libpurple/protocols/mxit/mxit.c         |  2 +-
 libpurple/protocols/sametime/sametime.c |  2 +-
 4 files changed, 6 insertions(+), 4 deletions(-)

diffs (57 lines):

diff --git a/libpurple/protocols/jabber/message.c b/libpurple/protocols/jabber/message.c
--- a/libpurple/protocols/jabber/message.c
+++ b/libpurple/protocols/jabber/message.c
@@ -910,7 +910,7 @@ jabber_conv_support_custom_smileys(Jabbe
 		} else {
 			return FALSE;
 		}
-	} else {
+	} else if (PURPLE_IS_CHAT_CONVERSATION(conv)) {
 		chat = jabber_chat_find_by_conv(PURPLE_CHAT_CONVERSATION(conv));
 		if (chat) {
 			/* do not attempt to send custom smileys in a MUC with more than
@@ -921,6 +921,8 @@ jabber_conv_support_custom_smileys(Jabbe
 		} else {
 			return FALSE;
 		}
+	} else {
+		return FALSE;
 	}
 }
 
diff --git a/libpurple/protocols/msn/switchboard.c b/libpurple/protocols/msn/switchboard.c
--- a/libpurple/protocols/msn/switchboard.c
+++ b/libpurple/protocols/msn/switchboard.c
@@ -298,7 +298,7 @@ msn_switchboard_add_user(MsnSwitchBoard 
 	{
 		msn_servconn_set_idle_timeout(swboard->servconn, 0);
 		if (swboard->conv == NULL ||
-			PURPLE_IS_IM_CONVERSATION(swboard->conv))
+			!PURPLE_IS_CHAT_CONVERSATION(swboard->conv))
 		{
 			GList *l;
 
diff --git a/libpurple/protocols/mxit/mxit.c b/libpurple/protocols/mxit/mxit.c
--- a/libpurple/protocols/mxit/mxit.c
+++ b/libpurple/protocols/mxit/mxit.c
@@ -180,7 +180,7 @@ static void mxit_cb_chat_created( Purple
 		/* not our conversation */
 		return;
 	}
-	else if ( PURPLE_IS_CHAT_CONVERSATION( conv ) ) {
+	else if ( !PURPLE_IS_IM_CONVERSATION( conv ) ) {
 		/* wrong type of conversation */
 		return;
 	}
diff --git a/libpurple/protocols/sametime/sametime.c b/libpurple/protocols/sametime/sametime.c
--- a/libpurple/protocols/sametime/sametime.c
+++ b/libpurple/protocols/sametime/sametime.c
@@ -1279,7 +1279,7 @@ static void conversation_created_cb(Purp
   if(pd->gc != gc)
     return; /* not ours */
 
-  if(PURPLE_IS_CHAT_CONVERSATION(g_conv))
+  if(!PURPLE_IS_IM_CONVERSATION(g_conv))
     return; /* wrong type */
 
   who.user = (char *) purple_conversation_get_name(g_conv);



More information about the Commits mailing list