adium-1.4 2811:798b30797a1f: Store a per-chat preference for sho...

commits at adium.im commits at adium.im
Wed Nov 25 23:12:16 UTC 2009


details:	http://hg.adium.im/adium-1.4/rev/798b30797a1f
revision:	2811:798b30797a1f
author:		Evan Schoenberg
date:		Wed Nov 25 17:11:53 2009 -0600

Store a per-chat preference for show/join leave notices. This is uniqued only by the chat name, but I think that's appropriate; the preference will then apply to the same room regardless of the account with which you connect to it. Fixes #12034
(transplanted from 8776101641d604162e21af4710b2b67632d273e7)
Subject: adium-1.4 2812:50d3a714b11f: String comments

details:	http://hg.adium.im/adium-1.4/rev/50d3a714b11f
revision:	2812:50d3a714b11f
author:		Evan Schoenberg
date:		Wed Nov 25 17:12:06 2009 -0600

String comments
(transplanted from 6f3ccdb7caa137a9bef793dc316767d7eafc7371)

diffs (46 lines):

diff -r 2be3c3f42f04 -r 50d3a714b11f Plugins/Twitter Plugin/AITwitterAccount.m
--- a/Plugins/Twitter Plugin/AITwitterAccount.m	Tue Nov 24 07:25:54 2009 -0800
+++ b/Plugins/Twitter Plugin/AITwitterAccount.m	Wed Nov 25 17:12:06 2009 -0600
@@ -620,7 +620,7 @@
 	[menuItem setRepresentedObject:inContact];
 	[menuItemArray addObject:menuItem];	
 
-	menuItem = [[[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:[NSString stringWithFormat:AILocalizedString(@"Enable device notifications for %@",nil), inContact.UID]
+	menuItem = [[[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:[NSString stringWithFormat:AILocalizedString(@"Enable device notifications for %@", "Enable sending Twitter notifications to your phone (device)"), inContact.UID]
 																	 target:self
 																	 action:@selector(enableOrDisableNotifications:)
 															  keyEquivalent:@""] autorelease];
@@ -629,7 +629,7 @@
 	[menuItem setRepresentedObject:inContact];
 	[menuItemArray addObject:menuItem];
 
-	menuItem = [[[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:[NSString stringWithFormat:AILocalizedString(@"Disable device notifications for %@",nil), inContact.UID]
+	menuItem = [[[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:[NSString stringWithFormat:AILocalizedString(@"Disable device notifications for %@", "Disable sending Twitter notifications to your phone"), inContact.UID]
 																	 target:self
 																	 action:@selector(enableOrDisableNotifications:)
 															  keyEquivalent:@""] autorelease];
diff -r 2be3c3f42f04 -r 50d3a714b11f Source/AIChatController.m
--- a/Source/AIChatController.m	Tue Nov 24 07:25:54 2009 -0800
+++ b/Source/AIChatController.m	Wed Nov 25 17:12:06 2009 -0600
@@ -413,7 +413,9 @@
 		chat.identifier = identifier;
 		chat.isGroupChat = YES;
 		chat.chatCreationDictionary = chatCreationInfo;
-					
+		/* Negative preference so (default == NO) -> showing join/leave messages */
+		chat.showJoinLeave = ![[adium preferenceController] preferenceForKey:[NSString stringWithFormat:@"HideJoinLeave-%@", name]
+																	   group:PREF_GROUP_STATUS_PREFERENCES];		
 		[openChats addObject:chat];
 		
 		AILog(@"chatWithName:%@ identifier:%@ onAccount:%@ added <<%@>> [%@] [%@]",name,identifier,account,chat,openChats,chatCreationInfo);
@@ -844,6 +846,10 @@
 	}
 
 	chat.showJoinLeave = !chat.showJoinLeave;
+
+	[[adium preferenceController] setPreference:[NSNumber numberWithBool:!chat.showJoinLeave]
+										 forKey:[NSString stringWithFormat:@"HideJoinLeave-%@", chat.name]
+										  group:PREF_GROUP_STATUS_PREFERENCES];
 }
 
 /*!




More information about the commits mailing list