Adium

Changeset 18358

Show
Ignore:
Timestamp:
12/07/2006 11:53:24 AM (2 years ago)
Author:
evands
Message:

Libgaim AIM accounts now actually respect the other client's reported ability to do (or not do) a direct connect. This is one of many places where we really were ignoring basic information libgaim makes available...

Files:

Legend:

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

    r18340 r18358  
    262262 */ 
    263263- (BOOL)canSendImagesForChat:(AIChat *)inChat 
    264 
    265         //XXX Check against the chat's list object's capabilities for DirectIM 
    266         return ![inChat isGroupChat]; 
     264{        
     265        if ([inChat isGroupChat]) return NO; 
     266 
     267        OscarData *od = ((account && account->gc) ? account->gc->proto_data : NULL); 
     268        if (od) { 
     269                AIListObject *listObject = [inChat listObject]; 
     270                const char *contactUID = [[listObject UID] UTF8String]; 
     271                aim_userinfo_t *userinfo = aim_locate_finduserinfo(od, contactUID); 
     272                 
     273                if (userinfo && 
     274                        aim_sncmp(gaim_account_get_username(account), contactUID) && 
     275                        [listObject online]) { 
     276                        return (userinfo->capabilities & OSCAR_CAPABILITY_DIRECTIM); 
     277 
     278                } else { 
     279                        return NO; 
     280                } 
     281 
     282        } else { 
     283                return NO; 
     284        } 
    267285} 
    268286