| 141 | | //For AIM contacts, we get profiles by themselves and don't want this userInfo with all its fields, so |
|---|
| 142 | | //we override this method to prevent the information from reaching the rest of Adium. |
|---|
| 143 | | |
|---|
| 144 | | //For ICQ contacts, however, we want to pass this data on as the profile |
|---|
| 145 | | const char firstCharacter = [[theContact UID] characterAtIndex:0]; |
|---|
| 146 | | |
|---|
| 147 | | if ((firstCharacter >= '0' && firstCharacter <= '9') || [theContact isStranger]) { |
|---|
| | 143 | NSString *contactUID = [theContact UID]; |
|---|
| | 144 | const char firstCharacter = [contactUID characterAtIndex:0]; |
|---|
| | 145 | |
|---|
| | 146 | if ((firstCharacter >= '0' && firstCharacter <= '9')) { |
|---|
| | 147 | //For ICQ contacts, however, we want to pass this data on as the profile |
|---|
| | 149 | |
|---|
| | 150 | } else { |
|---|
| | 151 | //For AIM contacts, get the profile directly and pass it on rather than using the libgaim-formatted string |
|---|
| | 152 | OscarData *od = ((account && account->gc) ? account->gc->proto_data : NULL); |
|---|
| | 153 | |
|---|
| | 154 | if (od) { |
|---|
| | 155 | aim_userinfo_t *userinfo; |
|---|
| | 156 | userinfo = aim_locate_finduserinfo(od, [contactUID UTF8String]); |
|---|
| | 157 | if (userinfo && |
|---|
| | 158 | (userinfo->info_len > 0) && (userinfo->info) && (userinfo->info_encoding)) { |
|---|
| | 159 | gchar *tmp, *info_utf8; |
|---|
| | 160 | |
|---|
| | 161 | tmp = oscar_encoding_extract(userinfo->info_encoding); |
|---|
| | 162 | info_utf8 = oscar_encoding_to_utf8(tmp, userinfo->info, userinfo->info_len); |
|---|
| | 163 | g_free(tmp); |
|---|
| | 164 | if (info_utf8) { |
|---|
| | 165 | [super updateUserInfo:theContact withData:[NSString stringWithUTF8String:info_utf8]]; |
|---|
| | 166 | g_free(info_utf8); |
|---|
| | 167 | } |
|---|
| | 168 | } |
|---|
| | 169 | } |
|---|
| 291 | | /*! |
|---|
| 292 | | * @brief Allow a file transfer with an object? |
|---|
| 293 | | * |
|---|
| 294 | | * Only return YES if the user's capabilities include OSCAR_CAPABILITY_SENDFILE indicating support for file transfer |
|---|
| 295 | | */ |
|---|
| 296 | | - (BOOL)allowFileTransferWithListObject:(AIListObject *)inListObject |
|---|
| 297 | | { |
|---|
| 298 | | OscarData *od; |
|---|
| 299 | | aim_userinfo_t *userinfo; |
|---|
| 300 | | |
|---|
| 301 | | if ((gaim_account_is_connected(account)) && |
|---|
| 302 | | (od = account->gc->proto_data) && |
|---|
| 303 | | (userinfo = aim_locate_finduserinfo(od, [[inListObject UID] UTF8String]))) { |
|---|
| 304 | | |
|---|
| 305 | | return (userinfo->capabilities & OSCAR_CAPABILITY_SENDFILE); |
|---|
| 306 | | } |
|---|
| 307 | | |
|---|
| 308 | | return NO; |
|---|
| 309 | | } |
|---|
| 310 | | |
|---|