Adium

Changeset 13294

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

Merged [13289]: 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
  • branches/adium-0.8/Plugins/Gaim Service/ESGaimJabberAccount.m

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