adium 5271:dd73ec06e6d6: Fix some constant strings to use the #d...

commits at adium.im commits at adium.im
Wed Jan 23 12:09:29 UTC 2013


details:	http://hg.adium.im/adium/rev/dd73ec06e6d6
revision:	5271:dd73ec06e6d6
branch:		libotr4.0.0
author:		Thijs Alkemade <me at thijsalkema.de>
date:		Wed Jan 23 13:08:47 2013 +0100

Fix some constant strings to use the #defines, hide the warning when logging is turned off globally too.

diffs (56 lines):

diff -r f7f70ee380e8 -r dd73ec06e6d6 Frameworks/Adium Framework/Source/AIAccount.m
--- a/Frameworks/Adium Framework/Source/AIAccount.m	Wed Jan 23 12:40:49 2013 +0100
+++ b/Frameworks/Adium Framework/Source/AIAccount.m	Wed Jan 23 13:08:47 2013 +0100
@@ -1024,6 +1024,10 @@
 {
 	BOOL shouldLog = ![self isTemporary];
 	
+	if (shouldLog) {
+		shouldLog = [[adium.preferenceController preferenceForKey:KEY_LOGGER_ENABLE group:PREF_GROUP_LOGGING] boolValue];
+	}
+	
 	if(shouldLog && [[adium.preferenceController preferenceForKey:KEY_LOGGER_CERTAIN_ACCOUNTS group:PREF_GROUP_LOGGING] boolValue]) {
 		shouldLog = ![[self preferenceForKey:KEY_LOGGER_OBJECT_DISABLE
 									   group:PREF_GROUP_LOGGING] boolValue];
diff -r f7f70ee380e8 -r dd73ec06e6d6 Plugins/General Preferences/AIMessagePreferences.m
--- a/Plugins/General Preferences/AIMessagePreferences.m	Wed Jan 23 12:40:49 2013 +0100
+++ b/Plugins/General Preferences/AIMessagePreferences.m	Wed Jan 23 13:08:47 2013 +0100
@@ -23,6 +23,7 @@
 #import "AIMessageWindowController.h"
 #import "AILogByAccountWindowController.h"
 #import "AIWebKitMessageViewPlugin.h"
+#import "DCMessageContextDisplayPlugin.h"
 
 #define KEY_TABBAR_POSITION					@"Tab Bar Position"
 #define	PREF_GROUP_DUAL_WINDOW_INTERFACE	@"Dual Window Interface"
@@ -211,14 +212,14 @@
 
 - (BOOL)chatHistoryDisplayActive
 {
-	return ([[adium.preferenceController preferenceForKey:@"Display Message Context" group:@"Message Context Display"] boolValue] &&
-			[[adium.preferenceController preferenceForKey:@"Enable Logging" group:@"Logging"] boolValue]);
+	return ([[adium.preferenceController preferenceForKey:KEY_DISPLAY_CONTEXT group:PREF_GROUP_CONTEXT_DISPLAY] boolValue] &&
+			[[adium.preferenceController preferenceForKey:KEY_LOGGER_ENABLE group:PREF_GROUP_LOGGING] boolValue]);
 }
 - (void)setChatHistoryDisplayActive:(BOOL)flag
 {
 	[adium.preferenceController setPreference:[NSNumber	numberWithBool:flag]
-									   forKey:@"Display Message Context"
-										group:@"Message Context Display"];
+									   forKey:KEY_DISPLAY_CONTEXT
+										group:PREF_GROUP_CONTEXT_DISPLAY];
 }
 
 - (void)sheetDidEnd:(NSWindow *)sheet returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo
diff -r f7f70ee380e8 -r dd73ec06e6d6 Source/AIOTRTopBarLoggingWarningController.m
--- a/Source/AIOTRTopBarLoggingWarningController.m	Wed Jan 23 12:40:49 2013 +0100
+++ b/Source/AIOTRTopBarLoggingWarningController.m	Wed Jan 23 13:08:47 2013 +0100
@@ -61,7 +61,7 @@
 - (void)preferencesChangedForGroup:(NSString *)group key:(NSString *)key object:(AIListObject *)object preferenceDict:(NSDictionary *)prefDict firstTime:(BOOL)firstTime
 {
 	if ([key isEqualToString:KEY_LOGGER_SECURE_CHATS] || [key isEqualToString:KEY_LOGGER_CERTAIN_ACCOUNTS]
-		|| [key isEqualToString:KEY_LOGGER_OBJECT_DISABLE]) {
+		|| [key isEqualToString:KEY_LOGGER_OBJECT_DISABLE] || [key isEqualToString:KEY_LOGGER_ENABLE]) {
 		if (chat.shouldLog) {
 			[owner unhideTopBarController:self];
 		} else {




More information about the commits mailing list