diff options
author | George Hazan <george.hazan@gmail.com> | 2016-06-06 15:56:58 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-06-06 15:56:58 +0000 |
commit | 279001d256a5bc6075284c76d65bf64c420acc7c (patch) | |
tree | ab000b58e2ae24700f691947e15e2a19f3185aab | |
parent | 3d03ebefdd8f81e84275d858be1aa56aae1e12f1 (diff) |
minor code cleaning (stub removed)
git-svn-id: http://svn.miranda-ng.org/main/trunk@16928 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | plugins/AVS/src/main.cpp | 2 | ||||
-rw-r--r-- | plugins/AVS/src/poll.cpp | 13 | ||||
-rw-r--r-- | plugins/AVS/src/poll.h | 4 | ||||
-rw-r--r-- | plugins/AVS/src/services.cpp | 2 | ||||
-rw-r--r-- | plugins/AVS/src/utils.cpp | 2 |
5 files changed, 9 insertions, 14 deletions
diff --git a/plugins/AVS/src/main.cpp b/plugins/AVS/src/main.cpp index 8a4874413e..64475acfba 100644 --- a/plugins/AVS/src/main.cpp +++ b/plugins/AVS/src/main.cpp @@ -114,7 +114,7 @@ static int MetaChanged(WPARAM hMeta, LPARAM hSubContact) AVATARCACHEENTRY *ace;
// Get the node
- CacheNode *node = FindAvatarInCache(hSubContact, TRUE);
+ CacheNode *node = FindAvatarInCache(hSubContact, true);
if (node == NULL || !node->loaded) {
ace = (AVATARCACHEENTRY*)GetProtoDefaultAvatar(hSubContact);
QueueAdd(hSubContact);
diff --git a/plugins/AVS/src/poll.cpp b/plugins/AVS/src/poll.cpp index 16fdf87465..38d09b75e6 100644 --- a/plugins/AVS/src/poll.cpp +++ b/plugins/AVS/src/poll.cpp @@ -25,8 +25,6 @@ A queue to request items. One request is done at a time, REQUEST_WAIT_TIME milis ACKRESULT_STATUS. This thread only requests the avatar (and maybe add it to the cache queue)
*/
-#define REQUEST_WAIT_TIME 3000
-
// Time to wait before re-requesting an avatar that failed
#define REQUEST_FAIL_WAIT_TIME (3 * 60 * 60 * 1000)
@@ -99,7 +97,7 @@ static BOOL PollContactCanHaveAvatar(MCONTACT hContact, const char *szProto) // Return true if this contact has to be checked
static BOOL PollCheckContact(MCONTACT hContact)
{
- return !db_get_b(hContact, "ContactPhoto", "Locked", 0) && FindAvatarInCache(hContact, FALSE, TRUE) != NULL;
+ return !db_get_b(hContact, "ContactPhoto", "Locked", 0) && FindAvatarInCache(hContact, false, true) != NULL;
}
static void QueueRemove(MCONTACT hContact)
@@ -113,7 +111,8 @@ static void QueueRemove(MCONTACT hContact) }
}
-static void QueueAdd(MCONTACT hContact, int waitTime)
+// Add an contact to a queue
+void QueueAdd(MCONTACT hContact, int waitTime)
{
if (fei == NULL || g_shutDown)
return;
@@ -131,12 +130,6 @@ static void QueueAdd(MCONTACT hContact, int waitTime) queue.insert(item);
}
-// Add an contact to a queue
-void QueueAdd(MCONTACT hContact)
-{
- QueueAdd(hContact, REQUEST_WAIT_TIME);
-}
-
void ProcessAvatarInfo(MCONTACT hContact, int type, PROTO_AVATAR_INFORMATION *pai, const char *szProto)
{
QueueRemove(hContact);
diff --git a/plugins/AVS/src/poll.h b/plugins/AVS/src/poll.h index a7db946467..39678f2b4e 100644 --- a/plugins/AVS/src/poll.h +++ b/plugins/AVS/src/poll.h @@ -21,6 +21,8 @@ Boston, MA 02111-1307, USA. #ifndef __POLL_H__
# define __POLL_H__
+#define REQUEST_WAIT_TIME 3000
+
struct QueueItem
{
MCONTACT hContact;
@@ -31,6 +33,6 @@ void InitPolls(); void UninitPolls();
// Add an contact to a queue
-void QueueAdd(MCONTACT hContact);
+void QueueAdd(MCONTACT hContact, int waitTime = REQUEST_WAIT_TIME);
#endif // __POLL_H__
diff --git a/plugins/AVS/src/services.cpp b/plugins/AVS/src/services.cpp index 9e6b4ffe2b..3be64cf8df 100644 --- a/plugins/AVS/src/services.cpp +++ b/plugins/AVS/src/services.cpp @@ -34,7 +34,7 @@ INT_PTR GetAvatarBitmap(WPARAM hContact, LPARAM) hContact = GetContactThatHaveTheAvatar(hContact);
// Get the node
- CacheNode *node = FindAvatarInCache(hContact, TRUE);
+ CacheNode *node = FindAvatarInCache(hContact, true);
if (node == NULL || !node->loaded)
return (INT_PTR)GetProtoDefaultAvatar(hContact);
return (INT_PTR)node;
diff --git a/plugins/AVS/src/utils.cpp b/plugins/AVS/src/utils.cpp index 5167b3714e..4e7603c396 100644 --- a/plugins/AVS/src/utils.cpp +++ b/plugins/AVS/src/utils.cpp @@ -411,7 +411,7 @@ int ChangeAvatar(MCONTACT hContact, bool fLoad, bool fNotifyHist, int pa_format) hContact = GetContactThatHaveTheAvatar(hContact);
// Get the node
- CacheNode *node = FindAvatarInCache(hContact, g_AvatarHistoryAvail && fNotifyHist, TRUE);
+ CacheNode *node = FindAvatarInCache(hContact, g_AvatarHistoryAvail && fNotifyHist, true);
if (node == NULL)
return 0;
|