Adium

Changeset 23856

Show
Ignore:
Timestamp:
06/08/2008 07:03:31 PM (6 months ago)
Author:
zacw
Message:

Last minute addition to the advanced Message preferences: "Open chats as soon as contacts begin typing" -- this behaves exactly like the Pidgin plugin, which opens a new chat and displays "You feel a disturbance in the force..." when someone begins typing to you. This also adds a stop to processing the psychic stuff for non-contact-list contacts. Fixes #8112.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Plugins/Dual Window Interface/AIDualWindowInterfacePlugin.h

    r23389 r23856  
    4444#define KEY_WINDOW_LEVEL                                        @"Window Level" 
    4545#define KEY_WINDOW_HIDE                                         @"Hide While in Background" 
     46#define KEY_PSYCHIC                                                     @"Open Chats When typing Begins" 
    4647 
    4748@interface AIDualWindowInterfacePlugin : AIPlugin <AIInterfaceComponent> { 
  • trunk/Plugins/Dual Window Interface/ESDualWindowMessageAdvancedPreferences.h

    r17454 r23856  
    3131         
    3232        IBOutlet        NSButton                *checkBox_hide; 
     33        IBOutlet        NSButton                *checkBox_psychicOpen; 
    3334        IBOutlet        NSPopUpButton   *popUp_windowPosition; 
    3435} 
  • trunk/Plugins/Dual Window Interface/ESDualWindowMessageAdvancedPreferences.m

    r20770 r23856  
    6565                                                                                         forKey:KEY_WINDOW_HIDE 
    6666                                                                                          group:PREF_GROUP_DUAL_WINDOW_INTERFACE]; 
    67  
     67                 
     68        } else if (sender == checkBox_psychicOpen) { 
     69                [[adium preferenceController] setPreference:[NSNumber numberWithBool:([sender state] == NSOnState)] 
     70                                                                                         forKey:KEY_PSYCHIC 
     71                                                                                          group:PREF_GROUP_DUAL_WINDOW_INTERFACE]; 
     72         
    6873        } else if (sender == checkBox_customNameFormatting) { 
    6974                [[adium preferenceController] setPreference:[NSNumber numberWithBool:[sender state]] 
     
    132137         
    133138        [checkBox_hide setState:[[prefDict objectForKey:KEY_WINDOW_HIDE] boolValue]]; 
     139        [checkBox_psychicOpen setState:[[prefDict objectForKey:KEY_PSYCHIC] boolValue]]; 
    134140 
    135141        prefDict = [[adium preferenceController] preferencesForGroup:PREF_GROUP_WEBKIT_MESSAGE_DISPLAY]; 
  • trunk/Plugins/Purple Service/adiumPurpleSignals.m

    r23819 r23856  
    1616 
    1717#import "adiumPurpleSignals.h" 
     18#import "AIDualWindowInterfacePlugin.h" 
    1819#import <AIUtilities/AIObjectAdditions.h> 
     20#import <AIUtilities/AIAttributedStringAdditions.h> 
     21#import <Adium/AIPreferenceControllerProtocol.h> 
    1922#import <Adium/AIChatControllerProtocol.h> 
     23#import <Adium/AIInterfaceControllerProtocol.h> 
     24#import <Adium/AIContentControllerProtocol.h> 
    2025#import <Adium/AIChat.h> 
    2126#import <Adium/AIListContact.h> 
     27#import <Adium/AIContentStatus.h> 
    2228#import <Adium/ESFileTransfer.h> 
    2329 
     
    270276        CBPurpleAccount *account = accountLookup(acct); 
    271277        AIListContact *contact = contactLookupFromBuddy(purple_find_buddy(acct, name)); 
     278         
     279        // Don't do anything for those who aren't on our contact list. 
     280        if ([contact isStranger]) { 
     281                return; 
     282        } 
     283         
    272284        AIChat *chat = [[[AIObject sharedAdiumInstance] chatController] chatWithContact:contact]; 
     285 
     286        if ((typingState == AITyping) &&  
     287                ([[[[AIObject sharedAdiumInstance] preferenceController] preferenceForKey:KEY_PSYCHIC 
     288                                                                                                                                                   group:PREF_GROUP_DUAL_WINDOW_INTERFACE] boolValue]) && 
     289                (![chat isOpen])) { 
     290                 
     291                [[[AIObject sharedAdiumInstance] interfaceController] openChat:chat]; 
     292         
     293                /* 
     294                 * Use the Libpurple "psychic" tagline. If this is found to be confusing, we should switch to your own version. 
     295                 * The upside of using theirs is that clever gimmicky translations already exist. 
     296                 */ 
     297                AIContentStatus *statusMessage = [AIContentStatus statusInChat:chat 
     298                                                                                                                        withSource:contact 
     299                                                                                                                   destination:account 
     300                                                                                                                                  date:[NSDate date] 
     301                                                                                                                           message:[NSAttributedString stringWithString:[NSString stringWithUTF8String:_("You feel a disturbance in the force...")]] 
     302                                                                                                                          withType:@"psychic"]; 
     303                 
     304                [[[AIObject sharedAdiumInstance] contentController] receiveContentObject:statusMessage]; 
     305        } 
    273306         
    274307        [account typingUpdateForIMChat:chat typing:[NSNumber numberWithInt:typingState]]; 
  • trunk/Resources/en.lproj/DualWindowMessageAdvanced.nib/classes.nib

    r22048 r23856  
    1 
    2     IBClasses =     ( 
    3                 { 
    4             CLASS = AILocalizationButton; 
    5             LANGUAGE = ObjC; 
    6             OUTLETS =             { 
    7                 "view_anchorToLeftSide" = NSView; 
    8                 "view_anchorToRightSide" = NSView; 
    9                 "window_anchorOnLeftSide" = NSWindow; 
    10                 "window_anchorOnRightSide" = NSWindow; 
    11             }; 
    12             SUPERCLASS = NSButton; 
    13         }, 
    14                 { 
    15             CLASS = AILocalizationTextField; 
    16             LANGUAGE = ObjC; 
    17             OUTLETS =             { 
    18                 "view_anchorToLeftSide" = NSView; 
    19                 "view_anchorToRightSide" = NSView; 
    20                 "window_anchorOnLeftSide" = NSWindow; 
    21             }; 
    22             SUPERCLASS = NSTextField; 
    23         }, 
    24                 { 
    25             ACTIONS =             { 
    26                 changePreference = id; 
    27             }; 
    28             CLASS = AIPreferencePane; 
    29             LANGUAGE = ObjC; 
    30             OUTLETS =             { 
    31                 delegate = id; 
    32                 "textField_title" = NSTextField; 
    33                 view = NSView; 
    34                 "view_containerSubView" = NSView; 
    35                 "view_containerView" = NSView; 
    36             }; 
    37             SUPERCLASS = NSObject; 
    38         }, 
    39                 { 
    40             CLASS = ESDualWindowMessageAdvancedPreferences; 
    41             LANGUAGE = ObjC; 
    42             OUTLETS =             { 
    43                 "autohide_tabBar" = NSButton; 
    44                 "checkBox_allowInactiveClosing" = NSButton; 
    45                 "checkBox_animateDockIcon" = NSButton; 
    46                 "checkBox_badgeDockIcon" = NSButton; 
    47                 "checkBox_customNameFormatting" = NSButton; 
    48                 "checkBox_hide" = NSButton; 
    49                 "popUp_minimumFontSize" = NSPopUpButton; 
    50                 "popUp_nameFormat" = NSPopUpButton; 
    51                 "popUp_timeStampFormat" = NSPopUpButton; 
    52                 "popUp_windowPosition" = NSPopUpButton; 
    53             }; 
    54             SUPERCLASS = AIPreferencePane; 
    55         }, 
    56                 { 
    57             CLASS = FirstResponder; 
    58             LANGUAGE = ObjC; 
    59             SUPERCLASS = NSObject; 
    60         }, 
    61                 { 
    62             CLASS = NSObject; 
    63             LANGUAGE = ObjC; 
    64         } 
    65     ); 
    66     IBVersion = 1; 
    67 
     1<?xml version="1.0" encoding="UTF-8"?> 
     2<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 
     3<plist version="1.0"> 
     4<dict> 
     5        <key>IBClasses</key> 
     6        <array> 
     7                <dict> 
     8                        <key>CLASS</key> 
     9                        <string>NSApplication</string> 
     10                        <key>LANGUAGE</key> 
     11                        <string>ObjC</string> 
     12                        <key>SUPERCLASS</key> 
     13                        <string>NSResponder</string> 
     14                </dict> 
     15                <dict> 
     16                        <key>CLASS</key> 
     17                        <string>RBSplitView</string> 
     18                        <key>LANGUAGE</key> 
     19                        <string>ObjC</string> 
     20                        <key>OUTLETS</key> 
     21                        <dict> 
     22                                <key>delegate</key> 
     23                                <string>id</string> 
     24                        </dict> 
     25                        <key>SUPERCLASS</key> 
     26                        <string>RBSplitSubview</string> 
     27                </dict> 
     28                <dict> 
     29                        <key>CLASS</key> 
     30                        <string>NSTextField</string> 
     31                        <key>LANGUAGE</key> 
     32                        <string>ObjC</string> 
     33                        <key>SUPERCLASS</key> 
     34                        <string>NSControl</string> 
     35                </dict> 
     36                <dict> 
     37                        <key>CLASS</key> 
     38                        <string>AIAdvancedPreferencePane</string> 
     39                        <key>LANGUAGE</key> 
     40                        <string>ObjC</string> 
     41                        <key>SUPERCLASS</key> 
     42                        <string>AIModularPane</string> 
     43                </dict> 
     44                <dict> 
     45                        <key>CLASS</key> 
     46                        <string>RBSplitSubview</string> 
     47                        <key>LANGUAGE</key> 
     48                        <string>ObjC</string> 
     49                        <key>SUPERCLASS</key> 
     50                        <string>NSView</string> 
     51                </dict> 
     52                <dict> 
     53                        <key>ACTIONS</key> 
     54                        <dict> 
     55                                <key>adiumPrint</key> 
     56                                <string>id</string> 
     57                                <key>didAdjustSubviews</key> 
     58                                <string>RBSplitView</string> 
     59                                <key>prefsWindowWillClose</key> 
     60                                <string>SS_PrefsController</string> 
     61                                <key>toggleFindPanel</key> 
     62                                <string>id</string> 
     63                                <key>willAdjustSubviews</key> 
     64                                <string>RBSplitView</string> 
     65                        </dict> 
     66                        <key>CLASS</key> 
     67                        <string>NSObject</string> 
     68                        <key>LANGUAGE</key> 
     69                        <string>ObjC</string> 
     70                </dict> 
     71                <dict> 
     72                        <key>CLASS</key> 
     73                        <string>AILocalizationButton</string> 
     74                        <key>LANGUAGE</key> 
     75                        <string>ObjC</string> 
     76                        <key>OUTLETS</key> 
     77                        <dict> 
     78                                <key>view_anchorToLeftSide</key> 
     79                                <string>NSView</string> 
     80                                <key>view_anchorToRightSide</key> 
     81                                <string>NSView</string> 
     82                                <key>window_anchorOnLeftSide</key> 
     83                                <string>NSWindow</string> 
     84                                <key>window_anchorOnRightSide</key> 
     85                                <string>NSWindow</string> 
     86                        </dict> 
     87                        <key>SUPERCLASS</key> 
     88                        <string>NSButton</string> 
     89                </dict> 
     90                <dict> 
     91                        <key>CLASS</key> 
     92                        <string>NSWindow</string> 
     93                        <key>LANGUAGE</key> 
     94                        <string>ObjC</string> 
     95                        <key>SUPERCLASS</key> 
     96                        <string>NSResponder</string> 
     97                </dict> 
     98                <dict> 
     99                        <key>CLASS</key> 
     100                        <string>FirstResponder</string> 
     101                        <key>LANGUAGE</key> 
     102                        <string>ObjC</string> 
     103                        <key>SUPERCLASS</key> 
     104                        <string>NSObject</string> 
     105                </dict> 
     106                <dict> 
     107                        <key>ACTIONS</key> 
     108                        <dict> 
     109                                <key>changePreference</key> 
     110                                <string>id</string> 
     111                        </dict> 
     112                        <key>CLASS</key> 
     113                        <string>AIModularPane</string> 
     114                        <key>LANGUAGE</key> 
     115                        <string>ObjC</string> 
     116                        <key>OUTLETS</key> 
     117                        <dict> 
     118                                <key>plugin</key> 
     119                                <string>id</string> 
     120                                <key>view</key> 
     121                                <string>NSView</string> 
     122                        </dict> 
     123                        <key>SUPERCLASS</key> 
     124                        <string>AIObject</string> 
     125                </dict> 
     126                <dict> 
     127                        <key>CLASS</key> 
     128                        <string>NSButton</string> 
     129                        <key>LANGUAGE</key> 
     130                        <string>ObjC</string> 
     131                        <key>SUPERCLASS</key> 
     132                        <string>NSControl</string> 
     133                </dict> 
     134                <dict> 
     135                        <key>CLASS</key> 
     136                        <string>AIObject</string> 
     137                        <key>LANGUAGE</key> 
     138                        <string>ObjC</string> 
     139                        <key>SUPERCLASS</key> 
     140                        <string>NSObject</string> 
     141                </dict> 
     142                <dict> 
     143                        <key>CLASS</key> 
     144                        <string>AILocalizationTextField</string> 
     145                        <key>LANGUAGE</key> 
     146                        <string>ObjC</string> 
     147                        <key>OUTLETS</key> 
     148                        <dict> 
     149                                <key>view_anchorToLeftSide</key> 
     150                                <string>NSView</string> 
     151                                <key>view_anchorToRightSide</key> 
     152                                <string>NSView</string> 
     153                                <key>window_anchorOnLeftSide</key> 
     154                                <string>NSWindow</string> 
     155                                <key>window_anchorOnRightSide</key> 
     156                                <string>NSWindow</string> 
     157                        </dict> 
     158                        <key>SUPERCLASS</key> 
     159                        <string>NSTextField</string> 
     160                </dict> 
     161                <dict> 
     162                        <key>CLASS</key> 
     163                        <string>NSButtonCell</string> 
     164                        <key>LANGUAGE</key> 
     165                        <string>ObjC</string> 
     166                        <key>SUPERCLASS</key> 
     167                        <string>NSActionCell</string> 
     168                </dict> 
     169                <dict> 
     170                        <key>CLASS</key> 
     171                        <string>ESDualWindowMessageAdvancedPreferences</string> 
     172                        <key>LANGUAGE</key> 
     173                        <string>ObjC</string> 
     174                        <key>OUTLETS</key> 
     175                        <dict> 
     176                                <key>autohide_tabBar</key> 
     177                                <string>NSButton</string> 
     178                                <key>checkBox_allowInactiveClosing</key> 
     179                                <string>NSButton</string> 
     180                                <key>checkBox_animateDockIcon</key> 
     181                                <string>NSButton</string> 
     182                                <key>checkBox_badgeDockIcon</key> 
     183                                <string>NSButton</string> 
     184                                <key>checkBox_customNameFormatting</key> 
     185                                <string>NSButton</string> 
     186                                <key>checkBox_hide</key> 
     187                                <string>NSButton</string> 
     188                                <key>checkBox_psychicOpen</key> 
     189                                <string>NSButton</string> 
     190                                <key>popUp_minimumFontSize</key> 
     191                                <string>NSPopUpButton</string> 
     192                                <key>popUp_nameFormat</key> 
     193                                <string>NSPopUpButton</string> 
     194                                <key>popUp_timeStampFormat</key> 
     195                                <string>NSPopUpButton</string> 
     196                                <key>popUp_windowPosition</key> 
     197                                <string>NSPopUpButton</string> 
     198                        </dict> 
     199                        <key>SUPERCLASS</key> 
     200                        <string>AIAdvancedPreferencePane</string> 
     201                </dict> 
     202                <dict> 
     203                        <key>CLASS</key> 
     204                        <string>SS_PrefsController</string> 
     205                        <key>LANGUAGE</key> 
     206                        <string>ObjC</string> 
     207                        <key>OUTLETS</key> 
     208                        <dict> 
     209                                <key>delegate</key> 
     210                                <string>id</string> 
     211                        </dict> 
     212                        <key>SUPERCLASS</key> 
     213                        <string>NSObject</string> 
     214                </dict> 
     215        </array> 
     216        <key>IBVersion</key> 
     217        <string>1</string> 
     218</dict> 
     219</plist> 
  • trunk/Resources/en.lproj/DualWindowMessageAdvanced.nib/info.nib

    r22048 r23856  
    33<plist version="1.0"> 
    44<dict> 
    5         <key>IBDocumentLocation</key> 
    6         <string>36 262 356 240 0 0 1440 878 </string> 
    7         <key>IBEditorPositions</key> 
    8         <dict> 
    9                 <key>6</key> 
    10                 <string>544 390 351 380 0 0 1440 878 </string> 
    11         </dict> 
    125        <key>IBFramework Version</key> 
    13         <string>482.0</string> 
     6        <string>629</string> 
     7        <key>IBLastKnownRelativeProjectPath</key> 
     8        <string>../../../Adium.xcodeproj</string> 
     9        <key>IBOldestOS</key> 
     10        <integer>5</integer> 
    1411        <key>IBOpenObjects</key> 
    1512        <array> 
     
    1714        </array> 
    1815        <key>IBSystem Version</key> 
    19         <string>9B18</string> 
    20         <key>IBUsesTextArchiving</key> 
    21         <true/
     16        <string>9D34</string> 
     17        <key>targetFramework</key> 
     18        <string>IBCocoaFramework</string
    2219</dict> 
    2320</plist>