Adium

Changeset 13293

Show
Ignore:
Timestamp:
08/29/2005 09:38:03 PM (3 years ago)
Author:
evands
Message:

Fixed -[ESGaimJabberAccount host] to return the connect host if applicable and otherwise to return the name determined from the jabber ID as before. This fixes issues with autoconnect of Jabber accounts and therefore fixes #898

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Plugins/Gaim Service/ESGaimJabberAccount.m

    r13093 r13293  
    172172 * Rather than having a separate server field, Jabber uses the servername after the user name. 
    173173 * username@server.org 
     174 * 
     175 * The connect server, stored in KEY_JABBER_CONNECT_SERVER, overrides this to provide the connect host. It will 
     176 * not be set in most cases. 
    174177 */ 
    175178- (NSString *)host 
    176179{ 
    177         int location = [UID rangeOfString:@"@"].location; 
    178         if ((location != NSNotFound) && (location + 1 < [UID length])) { 
    179                 return [UID substringFromIndex:(location + 1)]; 
    180         } else { 
    181                 return DEFAULT_JABBER_HOST; 
    182         } 
     180        NSString        *host; 
     181         
     182        if (!(host = [self preferenceForKey:KEY_JABBER_CONNECT_SERVER group:GROUP_ACCOUNT_STATUS])) { 
     183                int location = [UID rangeOfString:@"@"].location; 
     184 
     185                if ((location != NSNotFound) && (location + 1 < [UID length])) { 
     186                        host = [UID substringFromIndex:(location + 1)]; 
     187 
     188                } else { 
     189                        host = DEFAULT_JABBER_HOST; 
     190                } 
     191        } 
     192         
     193        return host; 
    183194} 
    184195