adium 2848:d88a4b7a70a8: Display unhandled purple conversation w...
commits at adium.im
commits at adium.im
Sun Nov 1 19:05:31 UTC 2009
details: http://hg.adium.im/adium/rev/d88a4b7a70a8
revision: 2848:d88a4b7a70a8
author: Zachary West <zacw at adium.im>
date: Sun Nov 01 14:04:11 2009 -0500
Display unhandled purple conversation writes in the next run loop. Fixes #13190.
diffs (121 lines):
diff -r ecda51fe4614 -r d88a4b7a70a8 Frameworks/AIUtilities Framework/Source/AIObjectAdditions.h
--- a/Frameworks/AIUtilities Framework/Source/AIObjectAdditions.h Sun Nov 01 11:15:19 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIObjectAdditions.h Sun Nov 01 14:04:11 2009 -0500
@@ -29,10 +29,13 @@
- (void)mainPerformSelector:(SEL)aSelector withObjects:(id)argument1, ... NS_REQUIRES_NIL_TERMINATION;
- (void)mainPerformSelector:(SEL)aSelector withObject:(id)argument1 withObject:(id)argument2 withObject:(id)argument3 withObject:(id)argument4 waitUntilDone:(BOOL)flag;
+
- (void)performSelector:(SEL)aSelector withObject:(id)argument1 withObject:(id)argument2 afterDelay:(NSTimeInterval)delay;
- (void)performSelector:(SEL)aSelector withObject:(id)argument1 withObject:(id)argument2 withObject:(id)argument3 afterDelay:(NSTimeInterval)delay;
- (void)performSelector:(SEL)aSelector withObject:(id)argument1 withObject:(id)argument2 withObject:(id)argument3;
+- (void)performSelector:(SEL)aSelector withObject:(id)argument1 withObject:(id)argument2 withObject:(id)argument3 withObject:(id)argument4 afterDelay:(NSTimeInterval)delay;
+
- (void)handleInvocation:(NSInvocation *)anInvocation;
@end
diff -r ecda51fe4614 -r d88a4b7a70a8 Frameworks/AIUtilities Framework/Source/AIObjectAdditions.m
--- a/Frameworks/AIUtilities Framework/Source/AIObjectAdditions.m Sun Nov 01 11:15:19 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIObjectAdditions.m Sun Nov 01 14:04:11 2009 -0500
@@ -261,6 +261,21 @@
[self performSelector:@selector(handleInvocation:) withObject:invocation];
}
+- (void)performSelector:(SEL)aSelector withObject:(id)argument1 withObject:(id)argument2 withObject:(id)argument3 withObject:(id)argument4 afterDelay:(NSTimeInterval)delay
+{
+ NSInvocation *invocation;
+ invocation = [NSInvocation invocationWithMethodSignature:[self methodSignatureForSelector:aSelector]];
+
+ [invocation setSelector:aSelector];
+ [invocation setArgument:&argument1 atIndex:2];
+ [invocation setArgument:&argument2 atIndex:3];
+ [invocation setArgument:&argument3 atIndex:4];
+ [invocation setArgument:&argument4 atIndex:5];
+ [invocation retainArguments];
+
+ [self performSelector:@selector(handleInvocation:) withObject:invocation afterDelay:delay];
+}
+
- (void)handleInvocation:(NSInvocation *)anInvocation
{
[anInvocation invokeWithTarget:self];
diff -r ecda51fe4614 -r d88a4b7a70a8 Plugins/Purple Service/CBPurpleAccount.h
--- a/Plugins/Purple Service/CBPurpleAccount.h Sun Nov 01 11:15:19 2009 -0500
+++ b/Plugins/Purple Service/CBPurpleAccount.h Sun Nov 01 14:04:11 2009 -0500
@@ -146,7 +146,7 @@
- (void)receivedEventForChat:(AIChat *)chat
message:(NSString *)message
date:(NSDate *)date
- flags:(PurpleMessageFlags)flags;
+ flags:(NSNumber *)flagsNumber;
- (void)receivedIMChatMessage:(NSDictionary *)messageDict inChat:(AIChat *)chat;
- (void)receivedMultiChatMessage:(NSDictionary *)messageDict inChat:(AIChat *)chat;
- (void)leftChat:(AIChat *)chat;
diff -r ecda51fe4614 -r d88a4b7a70a8 Plugins/Purple Service/CBPurpleAccount.m
--- a/Plugins/Purple Service/CBPurpleAccount.m Sun Nov 01 11:15:19 2009 -0500
+++ b/Plugins/Purple Service/CBPurpleAccount.m Sun Nov 01 14:04:11 2009 -0500
@@ -1175,8 +1175,10 @@
- (void)receivedEventForChat:(AIChat *)chat
message:(NSString *)message
date:(NSDate *)date
- flags:(PurpleMessageFlags)flags
+ flags:(NSNumber *)flagsNumber
{
+ PurpleMessageFlags flags = [flagsNumber integerValue];
+
AIContentEvent *event = [AIContentEvent eventInChat:chat
withSource:nil
destination:self
diff -r ecda51fe4614 -r d88a4b7a70a8 Plugins/Purple Service/adiumPurpleConversation.m
--- a/Plugins/Purple Service/adiumPurpleConversation.m Sun Nov 01 11:15:19 2009 -0500
+++ b/Plugins/Purple Service/adiumPurpleConversation.m Sun Nov 01 14:04:11 2009 -0500
@@ -85,7 +85,7 @@
[account receivedEventForChat:groupChatLookupFromConv(conv)
message:messageString
date:date
- flags:flags];
+ flags:[NSNumber numberWithInteger:flags]];
} else {
NSAttributedString *attributedMessage = [AIHTMLDecoder decodeHTML:messageString];
NSNumber *purpleMessageFlags = [NSNumber numberWithInteger:flags];
@@ -213,15 +213,15 @@
*/
if (errorType != AIChatUnknownError) {
[accountLookup(purple_conversation_get_account(conv)) performSelector:@selector(errorForChat:type:)
- withObject:chat
- withObject:[NSNumber numberWithInteger:errorType]
- afterDelay:0];
+ withObject:chat
+ withObject:[NSNumber numberWithInteger:errorType]
+ afterDelay:0];
} else {
[adium.contentController performSelector:@selector(displayEvent:ofType:inChat:)
- withObject:messageString
- withObject:@"libpurpleMessage"
- withObject:chat
- afterDelay:0];
+ withObject:messageString
+ withObject:@"libpurpleMessage"
+ withObject:chat
+ afterDelay:0];
}
AILog(@"*** Conversation error %@: %@", chat, messageString);
@@ -264,10 +264,12 @@
if (shouldDisplayMessage) {
CBPurpleAccount *account = accountLookup(purple_conversation_get_account(conv));
- [account receivedEventForChat:chat
- message:messageString
- date:[NSDate dateWithTimeIntervalSince1970:mtime]
- flags:flags];
+ [account performSelector:@selector(receivedEventForChat:message:date:flags:)
+ withObject:chat
+ withObject:messageString
+ withObject:[NSDate dateWithTimeIntervalSince1970:mtime]
+ withObject:[NSNumber numberWithInteger:flags]
+ afterDelay:0];
}
}
}
More information about the commits
mailing list