adium 3101:5eada67609ee: Ignore fileTransfer events (and only fi...

commits at adium.im commits at adium.im
Wed Feb 3 18:07:57 UTC 2010


details:	http://hg.adium.im/adium/rev/5eada67609ee
revision:	3101:5eada67609ee
author:		Stephen Holt <sholt at adium.im>
date:		Wed Feb 03 13:05:37 2010 -0500

Ignore fileTransfer events (and only fileTransfer events) when filtering for emoticons.  Fixes #10927
(transplanted from d0720f14c160dcbe957a8922962dd573951ce76e)

diffs (24 lines):

diff -r e0513db38fb9 -r 5eada67609ee Source/AIEmoticonController.m
--- a/Source/AIEmoticonController.m	Tue Feb 02 19:35:42 2010 -0700
+++ b/Source/AIEmoticonController.m	Wed Feb 03 13:05:37 2010 -0500
@@ -29,6 +29,7 @@
 #import <AIUtilities/AIDictionaryAdditions.h>
 #import <AIUtilities/AICharacterSetAdditions.h>
 #import <Adium/AIChat.h>
+#import <Adium/AIContentEvent.h>
 
 #define EMOTICON_DEFAULT_PREFS				@"EmoticonDefaults"
 #define EMOTICONS_PATH_NAME					@"Emoticons"
@@ -134,7 +135,11 @@
 - (NSAttributedString *)filterAttributedString:(NSAttributedString *)inAttributedString context:(id)context
 {
     NSMutableAttributedString   *replacementMessage = nil;
-    if (inAttributedString) {
+		// We want to filter some status event messages (e.g. changes in status messages), but not fileTransfer messages.
+		// Filenames, afterall, should not have emoticons in them.
+    if (inAttributedString &&
+				!([context isKindOfClass:[AIContentEvent class]] &&
+					[[(AIContentEvent *)context type] rangeOfString:@"fileTransfer"].location == NSNotFound)) {
         /* First, we do a quick scan of the message for any characters that might end up being emoticons
          * This avoids having to do the slower, more complicated scan for the majority of messages.
 		 *




More information about the commits mailing list