Adium

Ticket #3677: AppleScriptJoinGroupChat.diff

File AppleScriptJoinGroupChat.diff, 4.5 kB (added by lxs, 2 years ago)

Adds an AppleScript command to join a group chat

  • Frameworks/Adium

    old new  
    156156        return chat; 
    157157} 
    158158 
     159/*! 
     160 * @brief AppleScript command to join a group chat. 
     161 */ 
     162- (AIChat *)joinGroupChatCommand:(NSScriptCommand *)command  
     163{ 
     164        NSDictionary    *evaluatedArguments = [command evaluatedArguments]; 
     165        NSString                *name = [evaluatedArguments objectForKey:@"roomName"]; 
     166        NSString                *serviceID = [evaluatedArguments objectForKey:@"serviceID"]; 
     167        NSDictionary    *info = [evaluatedArguments objectForKey:@"chatSettings"]; 
     168        AIService               *service; 
     169        NSArray                 *accounts; 
     170        AIAccount               *account; 
     171        AIChat                  *chat = nil; 
     172         
     173        service = [[adium accountController] firstServiceWithServiceID:serviceID]; 
     174        accounts = [[adium accountController] accountsCompatibleWithService: service]; 
     175        account = [accounts objectAtIndex: 0]; 
     176         
     177        if (account) { 
     178                // Join the group chat and set it as active 
     179                chat = [[adium chatController] chatWithName:name 
     180                                                                                  onAccount:account 
     181                                                                   chatCreationInfo:info]; 
     182                [[adium interfaceController] setActiveChat:chat]; 
     183        } 
     184         
     185        return chat; 
     186} 
     187 
    159188#pragma mark Running applescripts 
    160189 
    161190/*! 
  • Resources/AdiumSuite.scriptSuite

    old new  
    129129                        <dict> 
    130130                                <key>AdiumSuite.CreateChat</key> 
    131131                                <string>createChatCommand:</string> 
     132                                <key>AdiumSuite.JoinGroupChat</key> 
     133                                <string>joinGroupChatCommand:</string> 
    132134                        </dict> 
    133135                </dict> 
    134136                 
     
    804806                        <key>Type</key> 
    805807                        <string>AdiumSuite.AIChat</string> 
    806808                </dict> 
     809                 
     810                <key>JoinGroupChat</key> 
     811                <dict> 
     812                        <key>AppleEventClassCode</key> 
     813                        <string>AdIM</string> 
     814                        <key>AppleEventCode</key> 
     815                        <string>jCdM</string> 
     816                         
     817                        <key>Arguments</key> 
     818                        <dict> 
     819                                <key>serviceID</key> 
     820                                <dict> 
     821                                        <key>Optional</key> 
     822                                        <string>NO</string> 
     823                                        <key>AppleEventCode</key> 
     824                                        <string>svID</string> 
     825                                        <key>Type</key> 
     826                                        <string>NSString</string> 
     827                                </dict> 
     828                                <key>roomName</key> 
     829                                <dict> 
     830                                        <key>Optional</key> 
     831                                        <string>NO</string> 
     832                                        <key>AppleEventCode</key> 
     833                                        <string>rNam</string> 
     834                                        <key>Type</key> 
     835                                        <string>NSString</string> 
     836                                </dict> 
     837                                <key>chatSettings</key> 
     838                                <dict> 
     839                                        <key>Optional</key> 
     840                                        <string>NO</string> 
     841                                        <key>AppleEventCode</key> 
     842                                        <string>cSet</string> 
     843                                        <key>Type</key> 
     844                                        <string>NSDictionary</string> 
     845                                </dict> 
     846                        </dict> 
     847                        <key>CommandClass</key> 
     848                        <string>NSScriptCommand</string> 
     849                        <key>ResultAppleEventCode</key> 
     850                        <string>Acht</string> 
     851                        <key>Type</key> 
     852                        <string>AdiumSuite.AIChat</string> 
     853                </dict> 
    807854        </dict> 
    808855         
    809856        <? ************************************ Enumerations  ************************************ ?> 
  • Resources/AdiumSuite.scriptTerminology

    old new  
    518518                        <dict> 
    519519                                <key>AdiumSuite.CreateChat</key> 
    520520                                <string>createChatCommand:</string> 
     521                                <key>AdiumSuite.JoinGroupChat</key> 
     522                                <string>createChatCommand:</string> 
    521523                        </dict> 
    522524                </dict> 
    523525                <key>NSApplication</key> 
     
    640642                        <key>Name</key> 
    641643                        <string>create chat</string> 
    642644                </dict> 
     645                <key>JoinGroupChat</key> 
     646                <dict> 
     647                        <key>Arguments</key> 
     648                        <dict> 
     649                                <key>serviceID</key> 
     650                                <dict> 
     651                                        <key>Description</key> 
     652                                        <string>The service ID (such as AIM, MSN, Yahoo, Jabber, ICQ) on which the chat should be initiated.</string> 
     653                                        <key>Name</key> 
     654                                        <string>on service</string> 
     655                                </dict> 
     656                                <key>roomName</key> 
     657                                <dict> 
     658                                        <key>Description</key> 
     659                                        <string>The name of the chat room.</string> 
     660                                        <key>Name</key> 
     661                                        <string>with name</string> 
     662                                </dict> 
     663                                <key>chatSettings</key> 
     664                                <dict> 
     665                                        <key>Description</key> 
     666                                        <string>Service-specific settings for configuring the chat.</string> 
     667                                        <key>Name</key> 
     668                                        <string>with settings</string> 
     669                                </dict> 
     670                        </dict> 
     671                        <key>Description</key> 
     672                        <string>Join a group chat.</string> 
     673                        <key>Name</key> 
     674                        <string>join group chat</string> 
     675                </dict> 
    643676        </dict> 
    644677        <key>Description</key> 
    645678        <string>commands and classes for Adium scripting.</string>