From 161c6d929c7effecbed5ca80876443889c06d2c1 Mon Sep 17 00:00:00 2001 From: sje Date: Fri, 3 Aug 2007 03:42:42 +0000 Subject: avatar fix (thx again borkra) git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@321 4f64403b-2f21-0410-a795-97e2b3489a10 --- metacontacts/meta_services.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'metacontacts/meta_services.c') 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 } -- cgit v1.2.3