From eccbb5307a048e70ac4adb0d3fd333be28245fa8 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 28 Mar 2017 14:21:33 +0300 Subject: massive cleanup of useless cbSize fields --- plugins/RecentContacts/src/RecentContacts.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'plugins/RecentContacts/src') diff --git a/plugins/RecentContacts/src/RecentContacts.cpp b/plugins/RecentContacts/src/RecentContacts.cpp index d2570e7a55..4148295222 100644 --- a/plugins/RecentContacts/src/RecentContacts.cpp +++ b/plugins/RecentContacts/src/RecentContacts.cpp @@ -483,17 +483,16 @@ BOOL SaveLastUsedTimeStamp(MCONTACT hContact) int OnMsgEvent(WPARAM, LPARAM lParam) { MessageWindowEventData *ed = (MessageWindowEventData *)lParam; - if (ed->hContact == NULL) - return 0; - - if (ed->uType == MSG_WINDOW_EVT_OPEN) + if (ed->hContact != 0 && ed->uType == MSG_WINDOW_EVT_OPEN) SaveLastUsedTimeStamp(ed->hContact); - else if (ed->uType == MSG_WINDOW_EVT_CUSTOM) { - struct TABSRMM_SessionInfo *si = (struct TABSRMM_SessionInfo*) ed->local; - if (si != NULL) - if (si->evtCode == tabMSG_WINDOW_EVT_CUSTOM_BEFORESEND) - SaveLastUsedTimeStamp(ed->hContact); - } + return 0; +} + +int OnProtoBroadcast(WPARAM, LPARAM lParam) +{ + ACKDATA *ack = (ACKDATA*)lParam; + if (ack->type == ACKTYPE_MESSAGE && ack->result == ACKRESULT_SUCCESS) + SaveLastUsedTimeStamp(ack->hContact); return 0; } @@ -555,6 +554,7 @@ extern "C" __declspec(dllexport) int Load(void) HookEvent(ME_MSG_WINDOWEVENT, OnMsgEvent); HookEvent(ME_DB_CONTACT_SETTINGCHANGED, OnContactSettingChanged ); HookEvent(ME_OPT_INITIALISE, onOptInitialise); + HookEvent(ME_PROTO_ACK, OnProtoBroadcast); return 0; } -- cgit v1.2.3