comparison libpurple/conversation.c @ 28019:1082e1c25b30

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).
author Paul Aurich <paul@darkrain42.org>
date Sun, 26 Jul 2009 00:39:14 +0000
parents 01f1929d0936
children c81386a2b292 ce3bc26aa8cd
comparison
equal deleted inserted replaced
28018:3723ac957c77 28019:1082e1c25b30
293 g_return_val_if_fail(name != NULL, NULL); 293 g_return_val_if_fail(name != NULL, NULL);
294 294
295 /* Check if this conversation already exists. */ 295 /* Check if this conversation already exists. */
296 if ((conv = purple_find_conversation_with_account(type, name, account)) != NULL) 296 if ((conv = purple_find_conversation_with_account(type, name, account)) != NULL)
297 { 297 {
298 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT &&
299 !purple_conv_chat_has_left(PURPLE_CONV_CHAT(conv))) {
300 purple_debug_warning("conversation", "Trying to create multiple "
301 "chats (%s) with the same name is deprecated and will be "
302 "removed in libpurple 3.0.0", name);
303 }
304
305 /*
306 * This hack is necessary because some prpls (MSN) have unnamed chats
307 * that all use the same name. A PurpleConversation for one of those
308 * is only ever re-used if the user has left, so calls to
309 * purple_conversation_new need to fall-through to creating a new
310 * chat.
311 * TODO 3.0.0: Remove this workaround and mandate unique names.
312 */
298 if (purple_conversation_get_type(conv) != PURPLE_CONV_TYPE_CHAT || 313 if (purple_conversation_get_type(conv) != PURPLE_CONV_TYPE_CHAT ||
299 purple_conv_chat_has_left(PURPLE_CONV_CHAT(conv))) 314 purple_conv_chat_has_left(PURPLE_CONV_CHAT(conv)))
300 { 315 {
301 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) 316 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT)
302 purple_conversation_chat_cleanup_for_rejoin(conv); 317 purple_conversation_chat_cleanup_for_rejoin(conv);