diff options
author | George Hazan <ghazan@miranda.im> | 2020-02-06 20:29:24 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-02-06 20:29:24 +0300 |
commit | 0a289dfb53afd6f0c70b980b730e2f411f84a1f4 (patch) | |
tree | 7485f6b2a7eb7ae6cb160305a059ae41954493a1 /plugins/MessageState | |
parent | 0eed72c23ea6bcd30f835de99bb6c220e2cec1ad (diff) |
MessageState: code cleaning
Diffstat (limited to 'plugins/MessageState')
-rw-r--r-- | plugins/MessageState/src/utils.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/MessageState/src/utils.cpp b/plugins/MessageState/src/utils.cpp index e8006141a3..9dd3110133 100644 --- a/plugins/MessageState/src/utils.cpp +++ b/plugins/MessageState/src/utils.cpp @@ -13,5 +13,11 @@ time_t GetLastSentMessageTime(MCONTACT hContact) bool HasUnread(MCONTACT hContact)
{
- return (CheckProtoSupport(Proto_GetBaseAccountName(hContact))) && ((GetLastSentMessageTime(hContact) > g_plugin.getDword(hContact, DBKEY_MESSAGE_READ_TIME, 0)) && g_plugin.getDword(hContact, DBKEY_MESSAGE_READ_TIME, 0) != 0);
+ if (!CheckProtoSupport(Proto_GetBaseAccountName(hContact)))
+ return false;
+
+ if (GetLastSentMessageTime(hContact) <= g_plugin.getDword(hContact, DBKEY_MESSAGE_READ_TIME, 0))
+ return false;
+
+ return g_plugin.getDword(hContact, DBKEY_MESSAGE_READ_TIME, 0) != 0;
}
|