adium 5466:2115a454123e: Added -displayNameForContact: back with...

commits at adium.im commits at adium.im
Fri May 3 13:37:22 UTC 2013


details:	http://hg.adium.im/adium/rev/2115a454123e
revision:	5466:2115a454123e
branch:		adium-1.6
author:		Thijs Alkemade <me at thijsalkema.de>
date:		Fri May 03 15:36:53 2013 +0200

Added -displayNameForContact: back with lots of deprecation warnings. It now returns only the first nick for that contact. Refs #16377

Okay, doing this just because I miss the NickColor plugin. So what?

diffs (39 lines):

diff -r 0d3d3a9afde1 -r 2115a454123e Frameworks/Adium Framework/Source/AIGroupChat.h
--- a/Frameworks/Adium Framework/Source/AIGroupChat.h	Fri May 03 12:58:24 2013 +0200
+++ b/Frameworks/Adium Framework/Source/AIGroupChat.h	Fri May 03 15:36:53 2013 +0200
@@ -59,4 +59,6 @@
 
 - (NSString *)visibleObjectAtIndex:(NSUInteger)idx;
 
+- (NSString *)displayNameForContact:(AIListObject *)contact __attribute__((deprecated));
+
 @end
diff -r 0d3d3a9afde1 -r 2115a454123e Frameworks/Adium Framework/Source/AIGroupChat.m
--- a/Frameworks/Adium Framework/Source/AIGroupChat.m	Fri May 03 12:58:24 2013 +0200
+++ b/Frameworks/Adium Framework/Source/AIGroupChat.m	Fri May 03 15:36:53 2013 +0200
@@ -504,4 +504,25 @@
     return YES;
 }
 
+
+#pragma mark 1.5 compat
+
+- (NSString *)displayNameForContact:(AIListObject *)contact
+{
+	static dispatch_once_t onceToken;
+	dispatch_once(&onceToken, ^{
+		NSLog(@"-displayNameForContact: is deprecated in Adium 1.6 and above. Use -nicksForContact: or track participants by nickname. This message will be logged only once.");
+		AILogWithSignature(@"-displayNameForContact: is deprecated in Adium 1.6 and above. Use -nicksForContact: or track participants by nickname. This message will be logged only once.");
+		AILogBacktrace();
+	});
+	
+	for (NSString *nick in participatingNicks) {
+		if ([[participatingNicksContacts objectForKey:nick] isEqualTo:contact]) {
+			return nick;
+		}
+	}
+	
+	return nil;
+}
+
 @end




More information about the commits mailing list