adium 2469:65bb8930eb2d: Log context message objects as thoug th...

commits at adium.im commits at adium.im
Sun Jun 7 15:35:43 UTC 2009


details:	http://hg.adium.im/adium/rev/65bb8930eb2d
revision:	2469:65bb8930eb2d
author:		Zachary West <zacw at adium.im>
date:		Sun Jun 07 11:35:09 2009 -0400

Log context message objects as thoug they were messages. Fixes #12349.

In cases we don't want it logged, i.e. from the logs, we already set it not to process the content. However, in cases like Jabber persistent chat (or any 'delayed' message type), we display it like context but it's actually new content.

diffs (31 lines):

diff -r bf7a967fd0f4 -r 65bb8930eb2d ChangeLogs/Changes Between Betas.txt
--- a/ChangeLogs/Changes Between Betas.txt	Sat Jun 06 18:53:12 2009 -0700
+++ b/ChangeLogs/Changes Between Betas.txt	Sun Jun 07 11:35:09 2009 -0400
@@ -3,4 +3,5 @@
  * Added another ignored phrase for IRC server connection processes.
  * Fixed the growl notification queue from making messages seem to arrive slightly later than they did, when only a handful are to be displayed. (#12327)
  * Fixed improperly setting the Jabber connect server when registering a new account.
+ * Fixed logging of context loaded from persistent jabber chats. (#12349)
  * Moved Quit Confirmations to a new Confirmations advanced preference.
\ No newline at end of file
diff -r bf7a967fd0f4 -r 65bb8930eb2d Source/AILoggerPlugin.m
--- a/Source/AILoggerPlugin.m	Sat Jun 06 18:53:12 2009 -0700
+++ b/Source/AILoggerPlugin.m	Sun Jun 07 11:35:09 2009 -0400
@@ -33,6 +33,7 @@
 #import <Adium/AIContentNotification.h>
 #import <Adium/AIContentStatus.h>
 #import <Adium/AIContentEvent.h>
+#import <Adium/AIContentContext.h>
 #import <Adium/AIHTMLDecoder.h>
 #import <Adium/AIListContact.h>
 #import <Adium/AIListBookmark.h>
@@ -526,7 +527,8 @@
 		NSString		*contentType = [content type];
 		NSString		*date = [[[content date] dateWithCalendarFormat:nil timeZone:nil] ISO8601DateString];
 
-		if ([contentType isEqualToString:CONTENT_MESSAGE_TYPE]) {
+		if ([contentType isEqualToString:CONTENT_MESSAGE_TYPE] ||
+			[contentType isEqualToString:CONTENT_CONTEXT_TYPE]) {
 			NSMutableArray *attributeKeys = [NSMutableArray arrayWithObjects:@"sender", @"time", nil];
 			NSMutableArray *attributeValues = [NSMutableArray arrayWithObjects:[[content source] UID], date, nil];
 			AIXMLAppender  *appender = [self appenderForChat:chat];




More information about the commits mailing list