pidgin: dc4c5ef5: Deprecate multiple chats having the same...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Sat Jul 25 20:40:35 EDT 2009


-----------------------------------------------------------------
Revision: dc4c5ef5124888c4c8a45e572703edb992518a28
Ancestor: 26950548793f5dfc22fb683865b6f399f8a9e33d
Author: darkrain42 at pidgin.im
Date: 2009-07-26T00:39:14
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/dc4c5ef5124888c4c8a45e572703edb992518a28

Modified files:
        ChangeLog.API libpurple/conversation.c

ChangeLog: 

Deprecate multiple chats having the same name and complain in the log.

I didn't remove it outright for two reasons:
  1. Out-of-tree prpls currently use it that way.
  2. This is going to affect logs (currently they're either all saved
     to the same file(s)/folder(s) or it fails miserably, I'm unsure).

-------------- next part --------------
============================================================
--- ChangeLog.API	7574953b156e26f6e01800461a07d82498cd8ddd
+++ ChangeLog.API	43295ef22881c6bc5790ce74edb5244eba598df1
@@ -88,6 +88,8 @@ version 2.6.0 (??/??/2009):
 		* All DNS routines support internationalized domain names (IDNs) when
 		  libpurple is compiled with GNU libidn.
 		* status is set before emitting signals in purple_xfer_set_status.
+		* Creating multiple distinct chats with the same name (i.e. "MSN Chat")
+		  is deprecated and will be removed in libpurple 3.0.0.
 
 		Deprecated:
 		* buddy-added and buddy-removed blist signals
============================================================
--- libpurple/conversation.c	1a44bf93f933c38861f9e684c00211b5234c4ee2
+++ libpurple/conversation.c	3635f430eaa4701abeb4d6b6bcc6797ed7c41c23
@@ -295,6 +295,21 @@ purple_conversation_new(PurpleConversati
 	/* Check if this conversation already exists. */
 	if ((conv = purple_find_conversation_with_account(type, name, account)) != NULL)
 	{
+		if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT &&
+				!purple_conv_chat_has_left(PURPLE_CONV_CHAT(conv))) {
+			purple_debug_warning("conversation", "Trying to create multiple "
+					"chats (%s) with the same name is deprecated and will be "
+					"removed in libpurple 3.0.0", name);
+		}
+
+		/*
+		 * This hack is necessary because some prpls (MSN) have unnamed chats
+		 * that all use the same name.  A PurpleConversation for one of those
+		 * is only ever re-used if the user has left, so calls to
+		 * purple_conversation_new need to fall-through to creating a new
+		 * chat.
+		 * TODO 3.0.0: Remove this workaround and mandate unique names.
+		 */
 		if (purple_conversation_get_type(conv) != PURPLE_CONV_TYPE_CHAT ||
 				purple_conv_chat_has_left(PURPLE_CONV_CHAT(conv)))
 		{


More information about the Commits mailing list