adium-1.4 3610:93c8292bc1c8: Apply the same fix as a00b7964253b,...
commits at adium.im
commits at adium.im
Sun Aug 21 20:14:54 UTC 2011
details: http://hg.adium.im/adium-1.4/rev/93c8292bc1c8
revision: 3610:93c8292bc1c8
branch: (none)
author: Evan Schoenberg
date: Sun Aug 21 15:14:33 2011 -0500
Apply the same fix as a00b7964253b, but for group chats, again resolving a double-retain
(transplanted from a9560a8f30eb8e61e4a327d42b5376262ad7e30b)
diffs (34 lines):
diff -r 97743a0ab02c -r 93c8292bc1c8 Plugins/Purple Service/SLPurpleCocoaAdapter.m
--- a/Plugins/Purple Service/SLPurpleCocoaAdapter.m Mon Aug 15 23:19:09 2011 +0200
+++ b/Plugins/Purple Service/SLPurpleCocoaAdapter.m Sun Aug 21 15:14:33 2011 -0500
@@ -341,12 +341,29 @@
NSString *name = [NSString stringWithUTF8String:purple_conversation_get_name(conv)];
CBPurpleAccount *account = accountLookup(purple_conversation_get_account(conv));
+
+ /*
+ * Need to start a new chat, associating with the PurpleConversation.
+ *
+ * This may call back through to us recursively, via:
+ * -[CBPurpleAccount chatWithContact:identifier:]
+ * -[AIChatController chatWithContact:]
+ * -[CBPurpleAccount openChat:]
+ * -[SLPurpleCocoaAdaper openChat:onAccount:]
+ * convLookupFromChat()
+ * groupChatLookupFromConv()
+ *
+ * That's fine, as we'll get the same lookups the second time through; we just need to be cautious.
+ */
chat = [account chatWithName:name identifier:[NSValue valueWithPointer:conv]];
if (!chat.chatCreationDictionary) {
// If we don't have a chat creation dictionary (i.e., we didn't initiate the join), create one.
chat.chatCreationDictionary = [account extractChatCreationDictionaryFromConversation: conv];
}
- conv->ui_data = [chat retain];
+ if (conv->ui_data != chat) {
+ [(AIChat *)(conv->ui_data) release];
+ conv->ui_data = [chat retain];
+ }
AILog(@"group chat lookup assigned %@ to %p (%s)",chat,conv, purple_conversation_get_name(conv));
}
More information about the commits
mailing list