diff options
author | Robert Pösel <robyer@seznam.cz> | 2014-08-31 18:34:12 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2014-08-31 18:34:12 +0000 |
commit | cf488b3a97eb641d271cf0b3f183fc914ee0caf2 (patch) | |
tree | 6af6006ac7971c3bb9499258938ab36771b20ec4 /protocols/FacebookRM/src/proto.cpp | |
parent | b35a3607236bcd628d56290fe4a72977454ac1c7 (diff) |
Facebook: Save message read time into DB as key "MessageRead" (DWORD)
git-svn-id: http://svn.miranda-ng.org/main/trunk@10347 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src/proto.cpp')
-rw-r--r-- | protocols/FacebookRM/src/proto.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp index fe062681b2..b81f436cfa 100644 --- a/protocols/FacebookRM/src/proto.cpp +++ b/protocols/FacebookRM/src/proto.cpp @@ -65,6 +65,7 @@ FacebookProto::FacebookProto(const char* proto_name,const TCHAR* username) : db_set_resident(m_szModuleName, "Status"); db_set_resident(m_szModuleName, "IdleTS"); + db_set_resident(m_szModuleName, FACEBOOK_KEY_MESSAGE_READ); InitHotkeys(); InitPopups(); @@ -981,12 +982,17 @@ void FacebookProto::InitSounds() */ void FacebookProto::MessageRead(MCONTACT hContact) { - std::map<MCONTACT, time_t>::iterator it = facy.readers.find(hContact); + /*std::map<MCONTACT, time_t>::iterator it = facy.readers.find(hContact); if (it == facy.readers.end()) + return;*/ + + // We may use this instead of checing map as we have this info already in memory (this value is resident) + time_t time = getDword(hContact, FACEBOOK_KEY_MESSAGE_READ, 0); + if (!time) return; TCHAR ttime[64]; - _tcsftime(ttime, SIZEOF(ttime), _T("%X"), localtime(&it->second)); + _tcsftime(ttime, SIZEOF(ttime), _T("%X"), localtime(&time)); StatusTextData st = { 0 }; st.cbSize = sizeof(st); |