# HG changeset patch # User Paul Aurich # Date 1248568754 0 # Node ID 1082e1c25b30d8f3d6a92bda2490d3217ef23f1e # Parent 3723ac957c77a5a753c85c6efdf7a2b9d4b61f18 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). diff -r 3723ac957c77 -r 1082e1c25b30 ChangeLog.API --- a/ChangeLog.API Sun Jul 26 00:21:20 2009 +0000 +++ b/ChangeLog.API Sun Jul 26 00:39:14 2009 +0000 @@ -88,6 +88,8 @@ * 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 diff -r 3723ac957c77 -r 1082e1c25b30 libpurple/conversation.c --- a/libpurple/conversation.c Sun Jul 26 00:21:20 2009 +0000 +++ b/libpurple/conversation.c Sun Jul 26 00:39:14 2009 +0000 @@ -295,6 +295,21 @@ /* 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))) {