diff options
author | George Hazan <george.hazan@gmail.com> | 2016-04-28 11:27:27 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-04-28 11:27:27 +0000 |
commit | 7c2e75f14ad9dd186a85b17587c21c2561286581 (patch) | |
tree | fcd4db66a9b149cb7ee480a89d3f20582bea2823 /plugins/Clist_modern/src/modern_awaymsg.cpp | |
parent | 01433b81e943d57b1ec2ebb5758bd2a85d836753 (diff) |
- 2nd & 3rd lines handling unification;
- no need to copy data to make async calls;
- no need to launch a thread to save a couple of msecs on a very large roster;
- unused code & params cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@16785 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern/src/modern_awaymsg.cpp')
-rw-r--r-- | plugins/Clist_modern/src/modern_awaymsg.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/plugins/Clist_modern/src/modern_awaymsg.cpp b/plugins/Clist_modern/src/modern_awaymsg.cpp index 7a10a0cbb4..0cdae03c29 100644 --- a/plugins/Clist_modern/src/modern_awaymsg.cpp +++ b/plugins/Clist_modern/src/modern_awaymsg.cpp @@ -78,9 +78,6 @@ static void amThreadProc(void *) {
Netlib_Logf(NULL, "amThreadProc thread start");
- ClcCacheEntry dnce;
- memset(&dnce, 0, sizeof(dnce));
-
while (!MirandaExiting()) {
MCONTACT hContact = amGetCurrentChain();
while (hContact) {
@@ -90,22 +87,20 @@ static void amThreadProc(void *) if (MirandaExiting())
goto LBL_Exit;
}
- CListSettings_FreeCacheItemData(&dnce);
- dnce.hContact = hContact;
- Sync(CLUI_SyncGetPDNCE, (WPARAM)0, (LPARAM)&dnce);
+
+ ClcCacheEntry *pdnce = pcli->pfnGetCacheEntry(hContact);
HANDLE ACK = 0;
- if (dnce.ApparentMode != ID_STATUS_OFFLINE) //don't ask if contact is always invisible (should be done with protocol)
+ if (pdnce->ApparentMode != ID_STATUS_OFFLINE) //don't ask if contact is always invisible (should be done with protocol)
ACK = (HANDLE)CallContactService(hContact, PSS_GETAWAYMSG, 0, 0);
if (!ACK) {
ACKDATA ack;
ack.hContact = hContact;
ack.type = ACKTYPE_AWAYMSG;
ack.result = ACKRESULT_FAILED;
- ack.szModule = dnce.m_pszProto;
- ClcDoProtoAck(hContact, &ack);
+ ack.szModule = pdnce->m_pszProto;
+ ClcDoProtoAck(&ack);
}
- CListSettings_FreeCacheItemData(&dnce);
amRequestTick = time;
hContact = amGetCurrentChain();
if (hContact) {
|