From 95d43413eeef2a573d8e317088c8a0e108a3c3f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Sun, 6 Jul 2014 07:53:55 +0000 Subject: 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 --- protocols/FacebookRM/src/contacts.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'protocols/FacebookRM/src/contacts.cpp') 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 -- cgit v1.2.3