adium/adium

Parents 9253834ef1d1
Children 065178d1bc3e
Add a toolbar item that shows the current logging status for a conversation and allows the user to override it for that conversation only.

Also, removed the warning that was shown at the top before when logging and OTR were both on.

The images are still placeholders.

Fixes #8, refs #15729
--- a/Adium.xcodeproj/project.pbxproj Tue Jul 23 22:33:23 2013 +0200
+++ b/Adium.xcodeproj/project.pbxproj Mon Sep 09 22:33:40 2013 +0200
@@ -1377,8 +1377,6 @@
76AA110C1635585E00A6EC4B /* AIAccountSelectionTopBar.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76AA11091635585E00A6EC4B /* AIAccountSelectionTopBar.xib */; };
76AA110D1635585E00A6EC4B /* AIAccountSelectionViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 76AA110B1635585E00A6EC4B /* AIAccountSelectionViewController.m */; };
76AA1110163558B200A6EC4B /* AIRejoinGroupChatViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 76AA110F163558B200A6EC4B /* AIRejoinGroupChatViewController.m */; };
- 76B8B8EC16AF3A46009126FE /* AIOTRTopBarLoggingWarningController.m in Sources */ = {isa = PBXBuildFile; fileRef = 76B8B8EA16AF3A46009126FE /* AIOTRTopBarLoggingWarningController.m */; };
- 76B8B8ED16AF3A46009126FE /* AIOTRTopBarLoggingWarningController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76B8B8EB16AF3A46009126FE /* AIOTRTopBarLoggingWarningController.xib */; };
76C1AF9C125A906A00D269A9 /* AIAdiumURLProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = 76C1AF9B125A906A00D269A9 /* AIAdiumURLProtocol.m */; };
76FBDAC91733B9CA00C9F10B /* STTwitterHTML.m in Sources */ = {isa = PBXBuildFile; fileRef = 76FBDAC61733B9C900C9F10B /* STTwitterHTML.m */; };
76FF925A14B524B40043E23B /* AIIRCConsoleController.h in Headers */ = {isa = PBXBuildFile; fileRef = 76FF925814B524B40043E23B /* AIIRCConsoleController.h */; };
@@ -4463,9 +4461,6 @@
76AA110B1635585E00A6EC4B /* AIAccountSelectionViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AIAccountSelectionViewController.m; path = "Plugins/Dual Window Interface/AIAccountSelectionViewController.m"; sourceTree = "<group>"; };
76AA110E163558B200A6EC4B /* AIRejoinGroupChatViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AIRejoinGroupChatViewController.h; path = "Plugins/Dual Window Interface/AIRejoinGroupChatViewController.h"; sourceTree = "<group>"; };
76AA110F163558B200A6EC4B /* AIRejoinGroupChatViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AIRejoinGroupChatViewController.m; path = "Plugins/Dual Window Interface/AIRejoinGroupChatViewController.m"; sourceTree = "<group>"; };
- 76B8B8E916AF3A46009126FE /* AIOTRTopBarLoggingWarningController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AIOTRTopBarLoggingWarningController.h; path = Source/AIOTRTopBarLoggingWarningController.h; sourceTree = "<group>"; };
- 76B8B8EA16AF3A46009126FE /* AIOTRTopBarLoggingWarningController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AIOTRTopBarLoggingWarningController.m; path = Source/AIOTRTopBarLoggingWarningController.m; sourceTree = "<group>"; };
- 76B8B8EB16AF3A46009126FE /* AIOTRTopBarLoggingWarningController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = AIOTRTopBarLoggingWarningController.xib; path = Resources/AIOTRTopBarLoggingWarningController.xib; sourceTree = "<group>"; };
76C1AF9A125A906A00D269A9 /* AIAdiumURLProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AIAdiumURLProtocol.h; path = "Plugins/WebKit Message View/AIAdiumURLProtocol.h"; sourceTree = "<group>"; };
76C1AF9B125A906A00D269A9 /* AIAdiumURLProtocol.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AIAdiumURLProtocol.m; path = "Plugins/WebKit Message View/AIAdiumURLProtocol.m"; sourceTree = "<group>"; };
76FBDAC51733B9C900C9F10B /* STTwitterHTML.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = STTwitterHTML.h; path = "Plugins/Twitter Plugin/STTwitter/STTwitterHTML.h"; sourceTree = "<group>"; };
@@ -5251,9 +5246,6 @@
765F5D72162F48FA00C57904 /* AIOTRSMPSharedSecretWindowController.h */,
765F5D73162F48FB00C57904 /* AIOTRSMPSharedSecretWindowController.m */,
765F5D70162F483F00C57904 /* AIOTRSMPSharedSecretWindowController.xib */,
- 76B8B8E916AF3A46009126FE /* AIOTRTopBarLoggingWarningController.h */,
- 76B8B8EA16AF3A46009126FE /* AIOTRTopBarLoggingWarningController.m */,
- 76B8B8EB16AF3A46009126FE /* AIOTRTopBarLoggingWarningController.xib */,
76674645178D8A8F00F65048 /* AIOTRTopBarUnverifiedContactController.h */,
76674646178D8A9000F65048 /* AIOTRTopBarUnverifiedContactController.m */,
7667464B178D8B2700F65048 /* AIOTRTopBarUnverifiedContactController.xib */,
@@ -10012,7 +10004,6 @@
C613B1111640C370006683FF /* pref-profile.tiff in Resources */,
C613B143164112B3006683FF /* events-dock-name.tiff in Resources */,
C613B1451641210B006683FF /* events-contact.tiff in Resources */,
- 76B8B8ED16AF3A46009126FE /* AIOTRTopBarLoggingWarningController.xib in Resources */,
5A0BBC4317400544002A7BE0 /* emoticons_menu@2x.png in Resources */,
7667464C178D8B2700F65048 /* AIOTRTopBarUnverifiedContactController.xib in Resources */,
);
@@ -10664,7 +10655,6 @@
761D58831636EDE100210B12 /* AINewMessageTextFieldCell.m in Sources */,
761D58861636F94300210B12 /* AINewMessageSearchField.m in Sources */,
5A44595E169143130078AB0A /* AIPreferenceCVPrototypeView.m in Sources */,
- 76B8B8EC16AF3A46009126FE /* AIOTRTopBarLoggingWarningController.m in Sources */,
5A3B4D7916D878AC00903E40 /* NSString+STTwitter.m in Sources */,
5A3B4D7A16D878AC00903E40 /* STTwitterAPIWrapper.m in Sources */,
5A3B4D7C16D878AC00903E40 /* STTwitterOAuth.m in Sources */,
--- a/Frameworks/Adium Framework/Source/AIChat.h Tue Jul 23 22:33:23 2013 +0200
+++ b/Frameworks/Adium Framework/Source/AIChat.h Mon Sep 09 22:33:40 2013 +0200
@@ -132,6 +132,8 @@
NSDictionary *securityDetails;
AIListContact *_listObject;
+
+ NSNumber *overrideLogging;
}
+ (id)chatForAccount:(AIAccount *)inAccount;
@@ -195,6 +197,8 @@
@property (readwrite, nonatomic) BOOL hideUserIconAndStatus;
+@property (readwrite, nonatomic, retain) NSNumber *overrideLogging;
+
// Compatibility. I don't like this here.
- (NSArray *)containedObjects;
- (BOOL)isGroupChat;
--- a/Frameworks/Adium Framework/Source/AIChat.m Tue Jul 23 22:33:23 2013 +0200
+++ b/Frameworks/Adium Framework/Source/AIChat.m Mon Sep 09 22:33:40 2013 +0200
@@ -436,8 +436,14 @@
#pragma mark Logging
+@synthesize overrideLogging;
+
- (BOOL)shouldLog
{
+ if (overrideLogging) {
+ return [overrideLogging boolValue];
+ }
+
BOOL shouldLog = [self.account shouldLogChat:self];
if(shouldLog && self.isSecure) {
--- a/Resources/AIOTRTopBarLoggingWarningController.xib Tue Jul 23 22:33:23 2013 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,425 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00">
- <data>
- <int key="IBDocument.SystemTarget">1060</int>
- <string key="IBDocument.SystemVersion">12D78</string>
- <string key="IBDocument.InterfaceBuilderVersion">3084</string>
- <string key="IBDocument.AppKitVersion">1187.37</string>
- <string key="IBDocument.HIToolboxVersion">626.00</string>
- <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
- <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string key="NS.object.0">3084</string>
- </object>
- <array key="IBDocument.IntegratedClassDependencies">
- <string>NSButton</string>
- <string>NSButtonCell</string>
- <string>NSCustomObject</string>
- <string>NSCustomView</string>
- <string>NSTextField</string>
- <string>NSTextFieldCell</string>
- </array>
- <array key="IBDocument.PluginDependencies">
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- </array>
- <object class="NSMutableDictionary" key="IBDocument.Metadata">
- <string key="NS.key.0">PluginDependencyRecalculationVersion</string>
- <integer value="1" key="NS.object.0"/>
- </object>
- <array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
- <object class="NSCustomObject" id="1001">
- <string key="NSClassName">AIOTRTopBarLoggingWarningController</string>
- </object>
- <object class="NSCustomObject" id="1003">
- <string key="NSClassName">FirstResponder</string>
- </object>
- <object class="NSCustomObject" id="1004">
- <string key="NSClassName">NSApplication</string>
- </object>
- <object class="NSCustomView" id="209947746">
- <reference key="NSNextResponder"/>
- <int key="NSvFlags">266</int>
- <array class="NSMutableArray" key="NSSubviews">
- <object class="NSCustomView" id="709009510">
- <reference key="NSNextResponder" ref="209947746"/>
- <int key="NSvFlags">290</int>
- <array class="NSMutableArray" key="NSSubviews">
- <object class="NSButton" id="382479864">
- <reference key="NSNextResponder" ref="709009510"/>
- <int key="NSvFlags">265</int>
- <string key="NSFrame">{{551, 5}, {83, 19}}</string>
- <reference key="NSSuperview" ref="709009510"/>
- <reference key="NSWindow"/>
- <reference key="NSNextKeyView"/>
- <string key="NSReuseIdentifierKey">_NS:9</string>
- <bool key="NSEnabled">YES</bool>
- <object class="NSButtonCell" key="NSCell" id="271828053">
- <int key="NSCellFlags">-2080374784</int>
- <int key="NSCellFlags2">134217728</int>
- <string key="NSContents">Configure...</string>
- <object class="NSFont" key="NSSupport">
- <string key="NSName">LucidaGrande</string>
- <double key="NSSize">12</double>
- <int key="NSfFlags">16</int>
- </object>
- <string key="NSCellIdentifier">_NS:9</string>
- <reference key="NSControlView" ref="382479864"/>
- <int key="NSButtonFlags">-2038153216</int>
- <int key="NSButtonFlags2">164</int>
- <string key="NSAlternateContents"/>
- <string key="NSKeyEquivalent"/>
- <int key="NSPeriodicDelay">400</int>
- <int key="NSPeriodicInterval">75</int>
- </object>
- <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
- </object>
- <object class="NSTextField" id="453567343">
- <reference key="NSNextResponder" ref="709009510"/>
- <int key="NSvFlags">270</int>
- <string key="NSFrame">{{7, 7}, {354, 17}}</string>
- <reference key="NSSuperview" ref="709009510"/>
- <reference key="NSWindow"/>
- <reference key="NSNextKeyView" ref="382479864"/>
- <string key="NSReuseIdentifierKey">_NS:1535</string>
- <bool key="NSEnabled">YES</bool>
- <object class="NSTextFieldCell" key="NSCell" id="667515101">
- <int key="NSCellFlags">68157504</int>
- <int key="NSCellFlags2">4195328</int>
- <string key="NSContents">Your conversation is encrypted, but still logged by you.</string>
- <object class="NSFont" key="NSSupport">
- <string key="NSName">LucidaGrande</string>
- <double key="NSSize">13</double>
- <int key="NSfFlags">1044</int>
- </object>
- <string key="NSCellIdentifier">_NS:1535</string>
- <reference key="NSControlView" ref="453567343"/>
- <object class="NSColor" key="NSBackgroundColor">
- <int key="NSColorSpace">6</int>
- <string key="NSCatalogName">System</string>
- <string key="NSColorName">controlColor</string>
- <object class="NSColor" key="NSColor">
- <int key="NSColorSpace">3</int>
- <bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
- </object>
- </object>
- <object class="NSColor" key="NSTextColor">
- <int key="NSColorSpace">6</int>
- <string key="NSCatalogName">System</string>
- <string key="NSColorName">controlTextColor</string>
- <object class="NSColor" key="NSColor">
- <int key="NSColorSpace">3</int>
- <bytes key="NSWhite">MAA</bytes>
- </object>
- </object>
- </object>
- <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
- </object>
- </array>
- <string key="NSFrameSize">{641, 30}</string>
- <reference key="NSSuperview" ref="209947746"/>
- <reference key="NSWindow"/>
- <reference key="NSNextKeyView" ref="453567343"/>
- <string key="NSClassName">AITopBarGradientView</string>
- </object>
- </array>
- <string key="NSFrameSize">{641, 30}</string>
- <reference key="NSSuperview"/>
- <reference key="NSWindow"/>
- <reference key="NSNextKeyView" ref="709009510"/>
- <string key="NSReuseIdentifierKey">_NS:9</string>
- <string key="NSClassName">NSView</string>
- </object>
- </array>
- <object class="IBObjectContainer" key="IBDocument.Objects">
- <array class="NSMutableArray" key="connectionRecords">
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">view</string>
- <reference key="source" ref="1001"/>
- <reference key="destination" ref="209947746"/>
- </object>
- <int key="connectionID">18</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">view_backgroundView</string>
- <reference key="source" ref="1001"/>
- <reference key="destination" ref="709009510"/>
- </object>
- <int key="connectionID">19</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">configureLogging:</string>
- <reference key="source" ref="1001"/>
- <reference key="destination" ref="382479864"/>
- </object>
- <int key="connectionID">20</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">label_description</string>
- <reference key="source" ref="1001"/>
- <reference key="destination" ref="453567343"/>
- </object>
- <int key="connectionID">21</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">button_configure</string>
- <reference key="source" ref="1001"/>
- <reference key="destination" ref="382479864"/>
- </object>
- <int key="connectionID">22</int>
- </object>
- </array>
- <object class="IBMutableOrderedSet" key="objectRecords">
- <array key="orderedObjects">
- <object class="IBObjectRecord">
- <int key="objectID">0</int>
- <array key="object" id="0"/>
- <reference key="children" ref="1000"/>
- <nil key="parent"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">-2</int>
- <reference key="object" ref="1001"/>
- <reference key="parent" ref="0"/>
- <string key="objectName">File's Owner</string>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">-1</int>
- <reference key="object" ref="1003"/>
- <reference key="parent" ref="0"/>
- <string key="objectName">First Responder</string>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">-3</int>
- <reference key="object" ref="1004"/>
- <reference key="parent" ref="0"/>
- <string key="objectName">Application</string>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">3</int>
- <reference key="object" ref="209947746"/>
- <array class="NSMutableArray" key="children">
- <reference ref="709009510"/>
- </array>
- <reference key="parent" ref="0"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">4</int>
- <reference key="object" ref="709009510"/>
- <array class="NSMutableArray" key="children">
- <reference ref="382479864"/>
- <reference ref="453567343"/>
- </array>
- <reference key="parent" ref="209947746"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">5</int>
- <reference key="object" ref="382479864"/>
- <array class="NSMutableArray" key="children">
- <reference ref="271828053"/>
- </array>
- <reference key="parent" ref="709009510"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">8</int>
- <reference key="object" ref="271828053"/>
- <reference key="parent" ref="382479864"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">6</int>
- <reference key="object" ref="453567343"/>
- <array class="NSMutableArray" key="children">
- <reference ref="667515101"/>
- </array>
- <reference key="parent" ref="709009510"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">7</int>
- <reference key="object" ref="667515101"/>
- <reference key="parent" ref="453567343"/>
- </object>
- </array>
- </object>
- <dictionary class="NSMutableDictionary" key="flattenedProperties">
- <string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string key="-3.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string key="3.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string key="4.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string key="5.CustomClassName">AILocalizationButton</string>
- <string key="5.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string key="6.CustomClassName">AILocalizationTextField</string>
- <string key="6.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string key="7.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string key="8.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
- </dictionary>
- <dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
- <nil key="activeLocalization"/>
- <dictionary class="NSMutableDictionary" key="localizations"/>
- <nil key="sourceID"/>
- <int key="maxID">22</int>
- </object>
- <object class="IBClassDescriber" key="IBDocument.Classes">
- <array class="NSMutableArray" key="referencedPartialClassDescriptions">
- <object class="IBPartialClassDescription">
- <string key="className">AILocalizationButton</string>
- <string key="superclassName">NSButton</string>
- <dictionary class="NSMutableDictionary" key="outlets">
- <string key="view_anchorToLeftSide">NSView</string>
- <string key="view_anchorToRightSide">NSView</string>
- <string key="window_anchorOnLeftSide">NSWindow</string>
- <string key="window_anchorOnRightSide">NSWindow</string>
- </dictionary>
- <dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
- <object class="IBToOneOutletInfo" key="view_anchorToLeftSide">
- <string key="name">view_anchorToLeftSide</string>
- <string key="candidateClassName">NSView</string>
- </object>
- <object class="IBToOneOutletInfo" key="view_anchorToRightSide">
- <string key="name">view_anchorToRightSide</string>
- <string key="candidateClassName">NSView</string>
- </object>
- <object class="IBToOneOutletInfo" key="window_anchorOnLeftSide">
- <string key="name">window_anchorOnLeftSide</string>
- <string key="candidateClassName">NSWindow</string>
- </object>
- <object class="IBToOneOutletInfo" key="window_anchorOnRightSide">
- <string key="name">window_anchorOnRightSide</string>
- <string key="candidateClassName">NSWindow</string>
- </object>
- </dictionary>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBProjectSource</string>
- <string key="minorKey">./Classes/AILocalizationButton.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">AILocalizationTextField</string>
- <string key="superclassName">NSTextField</string>
- <dictionary class="NSMutableDictionary" key="outlets">
- <string key="view_anchorToLeftSide">NSView</string>
- <string key="view_anchorToRightSide">NSView</string>
- <string key="window_anchorOnLeftSide">NSWindow</string>
- <string key="window_anchorOnRightSide">NSWindow</string>
- </dictionary>
- <dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
- <object class="IBToOneOutletInfo" key="view_anchorToLeftSide">
- <string key="name">view_anchorToLeftSide</string>
- <string key="candidateClassName">NSView</string>
- </object>
- <object class="IBToOneOutletInfo" key="view_anchorToRightSide">
- <string key="name">view_anchorToRightSide</string>
- <string key="candidateClassName">NSView</string>
- </object>
- <object class="IBToOneOutletInfo" key="window_anchorOnLeftSide">
- <string key="name">window_anchorOnLeftSide</string>
- <string key="candidateClassName">NSWindow</string>
- </object>
- <object class="IBToOneOutletInfo" key="window_anchorOnRightSide">
- <string key="name">window_anchorOnRightSide</string>
- <string key="candidateClassName">NSWindow</string>
- </object>
- </dictionary>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBProjectSource</string>
- <string key="minorKey">./Classes/AILocalizationTextField.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">AIMessageViewTopBarController</string>
- <string key="superclassName">NSViewController</string>
- <object class="NSMutableDictionary" key="actions">
- <string key="NS.key.0">close:</string>
- <string key="NS.object.0">id</string>
- </object>
- <object class="NSMutableDictionary" key="actionInfosByName">
- <string key="NS.key.0">close:</string>
- <object class="IBActionInfo" key="NS.object.0">
- <string key="name">close:</string>
- <string key="candidateClassName">id</string>
- </object>
- </object>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBProjectSource</string>
- <string key="minorKey">./Classes/AIMessageViewTopBarController.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">AIOTRTopBarLoggingWarningController</string>
- <string key="superclassName">AIMessageViewTopBarController</string>
- <object class="NSMutableDictionary" key="actions">
- <string key="NS.key.0">configureLogging:</string>
- <string key="NS.object.0">id</string>
- </object>
- <object class="NSMutableDictionary" key="actionInfosByName">
- <string key="NS.key.0">configureLogging:</string>
- <object class="IBActionInfo" key="NS.object.0">
- <string key="name">configureLogging:</string>
- <string key="candidateClassName">id</string>
- </object>
- </object>
- <dictionary class="NSMutableDictionary" key="outlets">
- <string key="button_configure">NSButton</string>
- <string key="label_description">NSTextField</string>
- <string key="view_backgroundView">AITopBarGradientView</string>
- </dictionary>
- <dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
- <object class="IBToOneOutletInfo" key="button_configure">
- <string key="name">button_configure</string>
- <string key="candidateClassName">NSButton</string>
- </object>
- <object class="IBToOneOutletInfo" key="label_description">
- <string key="name">label_description</string>
- <string key="candidateClassName">NSTextField</string>
- </object>
- <object class="IBToOneOutletInfo" key="view_backgroundView">
- <string key="name">view_backgroundView</string>
- <string key="candidateClassName">AITopBarGradientView</string>
- </object>
- </dictionary>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBProjectSource</string>
- <string key="minorKey">./Classes/AIOTRTopBarLoggingWarningController.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">AITopBarGradientView</string>
- <string key="superclassName">NSView</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBProjectSource</string>
- <string key="minorKey">./Classes/AITopBarGradientView.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="NSMutableDictionary" key="actions">
- <string key="NS.key.0">selectServiceType:</string>
- <string key="NS.object.0">id</string>
- </object>
- <object class="NSMutableDictionary" key="actionInfosByName">
- <string key="NS.key.0">selectServiceType:</string>
- <object class="IBActionInfo" key="NS.object.0">
- <string key="name">selectServiceType:</string>
- <string key="candidateClassName">id</string>
- </object>
- </object>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBProjectSource</string>
- <string key="minorKey">./Classes/NSObject.h</string>
- </object>
- </object>
- </array>
- </object>
- <int key="IBDocument.localizationMode">0</int>
- <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
- <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
- <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
- <real value="1060" key="NS.object.0"/>
- </object>
- <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
- <int key="IBDocument.defaultPropertyAccessControl">3</int>
- </data>
-</archive>
--- a/Source/AILoggerPlugin.h Tue Jul 23 22:33:23 2013 +0200
+++ b/Source/AILoggerPlugin.h Mon Sep 09 22:33:40 2013 +0200
@@ -58,6 +58,9 @@
BOOL isIndexing;
SInt64 logsToIndex;
SInt64 logsIndexed;
+
+ // Chat window toolbar item
+ NSMutableSet *toolbarItems;
}
@property(assign,readonly) BOOL indexIsFlushing;
@property(assign,readonly) BOOL isIndexing;
--- a/Source/AILoggerPlugin.m Tue Jul 23 22:33:23 2013 +0200
+++ b/Source/AILoggerPlugin.m Mon Sep 09 22:33:40 2013 +0200
@@ -74,6 +74,8 @@
#define LOG_VIEWER_IDENTIFIER @"LogViewer"
+#define LOGGING_OVERRIDE_ITEM @"LoggingOverride"
+
#define ENABLE_PROXIMITY_SEARCH TRUE
#pragma mark -
@@ -138,6 +140,10 @@
- (void)_closeLogIndex;
- (void)_flushIndex:(SKIndexRef)inIndex;
+// Toolbar item
+- (IBAction)toggleLogging:(NSToolbarItem *)sender;
+- (void)updateToolbarItem:(NSToolbarItem *)item forChat:(AIChat *)chat;
+
// properties
@property(retain,readwrite) NSMutableDictionary *activeAppenders;
@property(retain,readwrite) AIHTMLDecoder *xhtmlDecoder;
@@ -218,6 +224,8 @@
logAppendingGroup = dispatch_group_create();
loggerPluginGroup = dispatch_group_create();
+ toolbarItems = [[NSMutableSet alloc] init];
+
ioQueue = dispatch_queue_create("im.adium.AILoggerPlugin.ioQueue", 0);
NSUInteger cpuCount = [[NSProcessInfo processInfo] activeProcessorCount];
@@ -304,6 +312,26 @@
selector:@selector(showLogViewerAndReindex:)
name:AIShowLogViewerAndReindexNotification
object:nil];
+
+ toolbarItem = [AIToolbarUtilities toolbarItemWithIdentifier:LOGGING_OVERRIDE_ITEM
+ label:AILocalizedString(@"Toggle Logging",nil)
+ paletteLabel:AILocalizedString(@"Toggle Logging",nil)
+ toolTip:AILocalizedString(@"Turn logging on or off for this conversation.",nil)
+ target:self
+ settingSelector:@selector(setImage:)
+ itemContent:[NSImage imageNamed:@"Authorize" forClass:NSClassFromString(@"AIAuthorizationRequestsWindowController")]
+ action:@selector(toggleLogging:)
+ menu:nil];
+ [[NSNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(toolbarWillAddItem:)
+ name:NSToolbarWillAddItemNotification
+ object:nil];
+ [[NSNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(toolbarDidRemoveItem:)
+ name:NSToolbarDidRemoveItemNotification
+ object:nil];
+
+ [adium.toolbarController registerToolbarItem:toolbarItem forToolbarType:@"TextEntry"];
}
- (void)uninstallPlugin
@@ -1722,4 +1750,80 @@
[pool release];
}
+#pragma mark Toolbar item
+
+- (void)updateToolbarItem:(NSToolbarItem *)item forChat:(AIChat *)chat
+{
+ if ([chat shouldLog]) {
+ [item setImage:[NSImage imageNamed:@"Authorize" forClass:NSClassFromString(@"AIAuthorizationRequestsWindowController")]];
+ [item setLabel:AILocalizedString(@"Turn Logging Off", nil)];
+ } else {
+ [item setImage:[NSImage imageNamed:@"Deny" forClass:NSClassFromString(@"AIAuthorizationRequestsWindowController")]];
+ [item setLabel:AILocalizedString(@"Turn Logging On", nil)];
+ }
+}
+
+- (IBAction)toggleLogging:(NSToolbarItem *)sender
+{
+ AIListObject *object = adium.interfaceController.selectedListObject;
+
+ if ([object isKindOfClass:[AIListContact class]]) {
+ AIChat *chat = [adium.chatController openChatWithContact:(AIListContact *)object
+ onPreferredAccount:YES];
+ chat.overrideLogging = @(![chat shouldLog]);
+
+ AILogWithSignature(@"Logging for this conversation is now %@", chat.overrideLogging);
+
+ [self updateToolbarItem:sender forChat:chat];
+ }
+}
+
+- (void)chatDidBecomeVisible:(NSNotification *)notification
+{
+ AIChat *chat = [notification object];
+ NSWindow *window = [[notification userInfo] objectForKey:@"NSWindow"];
+
+ for (NSToolbarItem *item in window.toolbar.items) {
+ if ([[item itemIdentifier] isEqualToString:LOGGING_OVERRIDE_ITEM]) {
+
+ [self updateToolbarItem:item forChat:chat];
+
+ break;
+ }
+ }
+}
+
+- (void)toolbarDidRemoveItem:(NSNotification *)notification
+{
+ NSToolbarItem *item = [[notification userInfo] objectForKey:@"item"];
+ if ([toolbarItems containsObject:item]) {
+ [item setView:nil];
+ [toolbarItems removeObject:item];
+
+ if ([toolbarItems count] == 0) {
+ [[NSNotificationCenter defaultCenter] removeObserver:self
+ name:@"AIChatDidBecomeVisible"
+ object:nil];
+ }
+ }
+}
+
+- (void)toolbarWillAddItem:(NSNotification *)notification
+{
+ NSToolbarItem *item = [[notification userInfo] objectForKey:@"item"];
+ if ([[item itemIdentifier] isEqualToString:LOGGING_OVERRIDE_ITEM]) {
+ [item setEnabled:YES];
+
+ //If this is the first item added, start observing for chats becoming visible so we can update the icon
+ if ([toolbarItems count] == 0) {
+ [[NSNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(chatDidBecomeVisible:)
+ name:@"AIChatDidBecomeVisible"
+ object:nil];
+ }
+
+ [toolbarItems addObject:item];
+ }
+}
+
@end
--- a/Source/AIOTRTopBarLoggingWarningController.h Tue Jul 23 22:33:23 2013 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-/*
- * Adium is the legal property of its developers, whose names are listed in the copyright file included
- * with this source distribution.
- *
- * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
- * General Public License as published by the Free Software Foundation; either version 2 of the License,
- * or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
- * Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program; if not,
- * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#import "AIMessageViewTopBarController.h"
-#import "AITopBarGradientView.h"
-
-@interface AIOTRTopBarLoggingWarningController : AIMessageViewTopBarController {
- IBOutlet AITopBarGradientView *view_backgroundView;
- IBOutlet NSTextField *label_description;
- IBOutlet NSButton *button_configure;
-
-}
-
-- (IBAction)configureLogging:(id)sender;
-
-@end
--- a/Source/AIOTRTopBarLoggingWarningController.m Tue Jul 23 22:33:23 2013 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +0,0 @@
-/*
- * Adium is the legal property of its developers, whose names are listed in the copyright file included
- * with this source distribution.
- *
- * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
- * General Public License as published by the Free Software Foundation; either version 2 of the License,
- * or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
- * Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program; if not,
- * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#import "AIOTRTopBarLoggingWarningController.h"
-#import "AIMessageViewController.h"
-#import <Adium/AIPreferenceControllerProtocol.h>
-#import "AIStringAdditions.h"
-
-#import "AILoggerPlugin.h"
-
-@implementation AIOTRTopBarLoggingWarningController
-
-- (id)init
-{
- self = [super initWithNibName:@"AIOTRTopBarLoggingWarningController"
- bundle:[NSBundle bundleForClass:[AIOTRTopBarLoggingWarningController class]]];
- if (self) {
- [self loadView];
-
- view_backgroundView.startColor = [NSColor colorWithCalibratedRed:1.0
- green:.95
- blue:.3
- alpha:1.0];
-
- view_backgroundView.endColor = [NSColor colorWithCalibratedRed:1.0
- green:.95
- blue:.5
- alpha:1.0];
-
- [label_description setStringValue:AILocalizedString(@"Your conversation is encrypted, but still logged by you.", nil)];
- [button_configure setStringValue:[AILocalizedString(@"Configure", nil) stringByAppendingEllipsis]];
-
- [adium.preferenceController registerPreferenceObserver:self
- forGroup:PREF_GROUP_LOGGING];
- }
-
- return self;
-}
-
-- (void)dealloc
-{
- [[NSNotificationCenter defaultCenter] removeObserver:self];
- [adium.preferenceController unregisterPreferenceObserver:self];
-
- [super dealloc];
-}
-
-- (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_ENABLE]) {
- if (chat.shouldLog) {
- [owner unhideTopBarController:self];
- } else {
- [owner hideTopBarController:self];
- }
- }
-}
-
-- (IBAction)configureLogging:(id)sender
-{
- [adium.preferenceController openPreferencesToCategoryWithIdentifier:@"Messages"];
-}
-
-- (void)chatStatusChanged:(NSNotification *)notification
-{
- NSArray *modifiedKeys = [[notification userInfo] objectForKey:@"Keys"];
-
- if ([modifiedKeys containsObject:@"securityDetails"]) {
- if ([[[chat securityDetails] objectForKey:@"EncryptionStatus"] integerValue] == EncryptionStatus_None
- || !chat.shouldLog) {
- [owner removeTopBarController:self];
- }
- }
-}
-
-- (void)setChat:(AIChat *)inChat
-{
- [[NSNotificationCenter defaultCenter] removeObserver:self];
-
- [chat release];
- chat = [inChat retain];
-
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(chatStatusChanged:)
- name:Chat_StatusChanged
- object:chat];
-}
-
-@end
--- a/Source/AdiumOTREncryption.m Tue Jul 23 22:33:23 2013 +0200
+++ b/Source/AdiumOTREncryption.m Mon Sep 09 22:33:40 2013 +0200
@@ -37,7 +37,6 @@
#import "OTRCommon.h"
#import "AIOTRSMPSecretAnswerWindowController.h"
#import "AIOTRSMPSharedSecretWindowController.h"
-#import "AIOTRTopBarLoggingWarningController.h"
#import "AIOTRTopBarUnverifiedContactController.h"
#import "AIMessageViewController.h"
@@ -1072,19 +1071,10 @@
fullSecurityDetailsDict = nil;
}
-
- NSInteger oldEncryptionStatus = [[[inChat securityDetails] objectForKey:@"EncryptionStatus"] integerValue];
-
[inChat setSecurityDetails:fullSecurityDetailsDict];
NSInteger newEncryptionStatus = [[securityDetailsDict objectForKey:@"EncryptionStatus"] integerValue];
- if (newEncryptionStatus != EncryptionStatus_None && oldEncryptionStatus == EncryptionStatus_None && inChat.shouldLog) {
- AIOTRTopBarLoggingWarningController *warningController = [[AIOTRTopBarLoggingWarningController alloc] init];
- AIMessageViewController *mvc = [[inChat chatContainer] messageViewController];
- [mvc addTopBarController:warningController];
- }
-
if (newEncryptionStatus == EncryptionStatus_Unverified) {
AIOTRTopBarUnverifiedContactController *warningController = [[AIOTRTopBarUnverifiedContactController alloc] init];
AIMessageViewController *mvc = [[inChat chatContainer] messageViewController];