--- a/Plugins/Purple Service/CBPurpleAccount.m Thu May 23 22:01:14 2013 +0200
+++ b/Plugins/Purple Service/CBPurpleAccount.m Thu May 23 22:25:59 2013 +0200
@@ -1235,13 +1235,24 @@
AILogWithSignature(@"Message: %@ inChat: %@ fromListContact: %@ flags: %d date: %@", attributedMessage, chat, sourceContact, flags, date);
+ if ((flags & PURPLE_MESSAGE_SEND) == PURPLE_MESSAGE_SEND) { + destination = [sourceContact.UID isEqualToString:self.UID]? (AIListObject *)self : (AIListObject *)sourceContact; + source = [sourceContact.UID isEqualToString:self.UID]? (AIListObject *)self : (AIListObject *)sourceContact; if ((flags & PURPLE_MESSAGE_DELAYED) == PURPLE_MESSAGE_DELAYED) {
// Display delayed messages as context.
AIContentContext *messageObject = [AIContentContext messageInChat:chat
- withSource:[sourceContact.UID isEqualToString:self.UID]? (AIListObject *)self : (AIListObject *)sourceContact
+ destination:destination message:attributedMessage
autoreply:(flags & PURPLE_MESSAGE_AUTO_RESP) != 0];
@@ -1251,9 +1262,9 @@
AIContentMessage *messageObject = [AIContentMessage messageInChat:chat
- withSource:[sourceContact.UID isEqualToString:self.UID]? (AIListObject *)self : (AIListObject *)sourceContact
+ destination:destination message:attributedMessage
autoreply:(flags & PURPLE_MESSAGE_AUTO_RESP) != 0];
--- a/Plugins/Purple Service/adiumPurpleConversation.m Thu May 23 22:01:14 2013 +0200
+++ b/Plugins/Purple Service/adiumPurpleConversation.m Thu May 23 22:25:59 2013 +0200
@@ -122,49 +122,53 @@
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- //We only care about this if it does not have the PURPLE_MESSAGE_SEND flag, which is set if Purple is sending a sent message back to us
- if ((flags & PURPLE_MESSAGE_SEND) == 0) {
- if (flags & PURPLE_MESSAGE_NOTIFY) {
- // We received a notification (nudge or buzz). Send a notification of such.
- NSString *type, *messageString = [NSString stringWithUTF8String:message];
- // Determine what we're actually notifying about.
- if ([messageString rangeOfString:@"nudge" options:(NSCaseInsensitiveSearch | NSLiteralSearch)].location != NSNotFound) {
- } else if ([messageString rangeOfString:@"buzz" options:(NSCaseInsensitiveSearch | NSLiteralSearch)].location != NSNotFound) {
- // Just call an unknown type a "notification"
- type = @"notification";
- [[NSNotificationCenter defaultCenter] postNotificationName:Chat_NudgeBuzzOccured
- object:chatLookupFromConv(conv)
- userInfo:[NSDictionary dictionaryWithObjectsAndKeys:
+ // We only care about this if it does not have the PURPLE_MESSAGE_SEND flag, which is set if Purple is sending a sent message back to us + // Or if it has both PURPLE_MESSAGE_SEND and PURPLE_MESSAGE_RECV: we received from the server a message that we supposedly sent ourselves. + if ((flags & PURPLE_MESSAGE_SEND) == PURPLE_MESSAGE_SEND && (flags & PURPLE_MESSAGE_RECV) == 0) { + if (flags & PURPLE_MESSAGE_NOTIFY) { + // We received a notification (nudge or buzz). Send a notification of such. + NSString *type, *messageString = [NSString stringWithUTF8String:message]; + // Determine what we're actually notifying about. + if ([messageString rangeOfString:@"nudge" options:(NSCaseInsensitiveSearch | NSLiteralSearch)].location != NSNotFound) { + } else if ([messageString rangeOfString:@"buzz" options:(NSCaseInsensitiveSearch | NSLiteralSearch)].location != NSNotFound) { - NSDictionary *messageDict;
- CBPurpleAccount *adiumAccount = accountLookup(purple_conversation_get_account(conv));
- NSString *messageString;
- messageString = [NSString stringWithUTF8String:message];
- chat = chatLookupFromConv(conv);
- AILog(@"adiumPurpleConvWriteIm: Received %@ from %@", messageString, chat.listObject.UID);
- //Process any purple imgstore references into real HTML tags pointing to real images
- messageString = processPurpleImages(messageString, adiumAccount);
- messageDict = [NSDictionary dictionaryWithObjectsAndKeys:messageString,@"Message",
- [NSNumber numberWithInteger:flags],@"PurpleMessageFlags",
- [NSDate dateWithTimeIntervalSince1970:mtime],@"Date",nil];
- [adiumAccount receivedIMChatMessage:messageDict
+ // Just call an unknown type a "notification" + type = @"notification"; + [[NSNotificationCenter defaultCenter] postNotificationName:Chat_NudgeBuzzOccured + object:chatLookupFromConv(conv) + userInfo:[NSDictionary dictionaryWithObjectsAndKeys: + NSDictionary *messageDict; + CBPurpleAccount *adiumAccount = accountLookup(purple_conversation_get_account(conv)); + NSString *messageString; + messageString = [NSString stringWithUTF8String:message]; + chat = chatLookupFromConv(conv); + AILog(@"adiumPurpleConvWriteIm: Received %@ from %@", messageString, chat.listObject.UID); + //Process any purple imgstore references into real HTML tags pointing to real images + messageString = processPurpleImages(messageString, adiumAccount); + messageDict = [NSDictionary dictionaryWithObjectsAndKeys:messageString,@"Message", + [NSNumber numberWithInteger:flags],@"PurpleMessageFlags", + [NSDate dateWithTimeIntervalSince1970:mtime],@"Date",nil]; + [adiumAccount receivedIMChatMessage:messageDict