diff options
Diffstat (limited to 'metacontacts/meta_services.c')
-rw-r--r-- | metacontacts/meta_services.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/metacontacts/meta_services.c b/metacontacts/meta_services.c index afc4ab5..88410ca 100644 --- a/metacontacts/meta_services.c +++ b/metacontacts/meta_services.c @@ -1768,28 +1768,25 @@ int Meta_GetAvatarInfo(WPARAM wParam, LPARAM lParam) { }
else
{
- HANDLE most_online;
- //DBEVENTINFO dbei;
+ HANDLE hSub, hMeta;
char szServiceName[100];
+ int result;
- most_online = Meta_GetMostOnlineSupporting(AI->hContact, PFLAGNUM_4, PF4_AVATARS);
+ hMeta = AI->hContact;
+ hSub = Meta_GetMostOnlineSupporting(AI->hContact, PFLAGNUM_4, PF4_AVATARS);
- if(!most_online)
+ if(!hSub)
return GAIR_NOAVATAR;
- proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)most_online, 0);
+ proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hSub, 0);
if(!proto) return GAIR_NOAVATAR;
- //Meta_CopyContactNick(AI->hContact, most_online, proto);
-
- AI->hContact = most_online;
+ AI->hContact = hSub;
- //Meta_SetNick(proto);
-
- _snprintf(szServiceName, sizeof(szServiceName), "%s%s", proto, PS_GETAVATARINFO);
- if (ServiceExists(szServiceName)) {
- return (int)(CallService(szServiceName, wParam, lParam));
- }
+ mir_snprintf(szServiceName, sizeof(szServiceName), "%s%s", proto, PS_GETAVATARINFO);
+ result = CallService(szServiceName, wParam, lParam);
+ AI->hContact = hMeta;
+ if (result != CALLSERVICE_NOTFOUND) return result;
}
return GAIR_NOAVATAR; // fail
}
|