diff options
author | Robert Pösel <robyer@seznam.cz> | 2014-07-06 07:53:55 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2014-07-06 07:53:55 +0000 |
commit | 95d43413eeef2a573d8e317088c8a0e108a3c3f7 (patch) | |
tree | a975e844823990ee8ec25409c5fd0d8074fcc3b9 /protocols/FacebookRM/src/contacts.cpp | |
parent | 7cf07cdfae771f29937815f5dafcb74af7d35664 (diff) |
Facebook: Set "Message read" info (if exists) on opening message window
git-svn-id: http://svn.miranda-ng.org/main/trunk@9698 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src/contacts.cpp')
-rw-r--r-- | protocols/FacebookRM/src/contacts.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/protocols/FacebookRM/src/contacts.cpp b/protocols/FacebookRM/src/contacts.cpp index 76939ee44b..a4834d6237 100644 --- a/protocols/FacebookRM/src/contacts.cpp +++ b/protocols/FacebookRM/src/contacts.cpp @@ -77,6 +77,8 @@ bool FacebookProto::IsMyContact(MCONTACT hContact, bool include_chat) MCONTACT FacebookProto::ChatIDToHContact(std::tstring chat_id) { + // TODO: use some cache to optimize this + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { if (!IsMyContact(hContact, true)) continue; @@ -91,6 +93,8 @@ MCONTACT FacebookProto::ChatIDToHContact(std::tstring chat_id) MCONTACT FacebookProto::ContactIDToHContact(std::string user_id) { + // TODO: use some cache to optimize this + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { if (isChatRoom(hContact)) continue; @@ -420,20 +424,20 @@ int FacebookProto::OnContactDeleted(WPARAM wParam,LPARAM) void FacebookProto::StartTyping(MCONTACT hContact) { // ignore if contact is already typing - if (facy.typing.find(hContact) != facy.typing.end()) + if (facy.typers.find(hContact) != facy.typers.end()) return; // show notification and insert into typing set CallService(MS_PROTO_CONTACTISTYPING, hContact, (LPARAM)FACEBOOK_TYPING_TIME); - facy.typing.insert(hContact); + facy.typers.insert(hContact); } void FacebookProto::StopTyping(MCONTACT hContact) { // ignore if contact is not typing - if (facy.typing.find(hContact) == facy.typing.end()) + if (facy.typers.find(hContact) == facy.typers.end()) return; // show notification and remove from typing set CallService(MS_PROTO_CONTACTISTYPING, hContact, (LPARAM)PROTOTYPE_CONTACTTYPING_OFF); - facy.typing.erase(hContact); + facy.typers.erase(hContact); }
\ No newline at end of file |