From b9eed106e74a7725f57b8175bc580a1520e1fe24 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 23 Jan 2014 20:29:14 +0000 Subject: patch for avatars reading optimization (by wsx22) git-svn-id: http://svn.miranda-ng.org/main/trunk@7843 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/AVS/src/poll.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'plugins/AVS/src/poll.cpp') diff --git a/plugins/AVS/src/poll.cpp b/plugins/AVS/src/poll.cpp index 840c3d78b9..beefe4e8ee 100644 --- a/plugins/AVS/src/poll.cpp +++ b/plugins/AVS/src/poll.cpp @@ -48,7 +48,8 @@ extern HANDLE hShutdownEvent; extern int DeleteAvatar(HANDLE hContact); extern void MakePathRelative(HANDLE hContact, TCHAR *path); int Proto_GetDelayAfterFail(const char *proto); -BOOL Proto_IsFetchingAlwaysAllowed(const char *proto); +BOOL Proto_IsFetchingWhenProtoNotVisibleAllowed(const char *proto); +BOOL Proto_IsFetchingWhenContactOfflineAllowed(const char *proto); #ifdef _DEBUG int _DebugTrace(const char *fmt, ...); @@ -89,7 +90,7 @@ static BOOL PollProtocolCanHaveAvatar(const char *szProto) int status = CallProtoService(szProto, PS_GETSTATUS, 0, 0); return (pCaps & PF4_AVATARS) && (g_szMetaName == NULL || strcmp(g_szMetaName, szProto)) - && ((status > ID_STATUS_OFFLINE && status != ID_STATUS_INVISIBLE) || Proto_IsFetchingAlwaysAllowed(szProto)); + && ((status > ID_STATUS_OFFLINE && status != ID_STATUS_INVISIBLE) || Proto_IsFetchingWhenProtoNotVisibleAllowed(szProto)); } // Return true if this protocol has to be checked @@ -102,7 +103,7 @@ static BOOL PollCheckProtocol(const char *szProto) static BOOL PollContactCanHaveAvatar(HANDLE hContact, const char *szProto) { int status = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE); - return (Proto_IsFetchingAlwaysAllowed(szProto) || status != ID_STATUS_OFFLINE) + return (Proto_IsFetchingWhenContactOfflineAllowed(szProto) || status != ID_STATUS_OFFLINE) && !db_get_b(hContact, "CList", "NotOnList", 0) && db_get_b(hContact, "CList", "ApparentMode", 0) != ID_STATUS_OFFLINE; } -- cgit v1.2.3