summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_events.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-07-21 16:17:48 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-07-21 16:17:48 +0300
commit5fd260b7c4c98bfa2d17a301d832a859c2af1f92 (patch)
tree648dfe9336191c8fafdf7772f376f8e60337388a /protocols/JabberG/src/jabber_events.cpp
parent17b6a94812b2dbf4af29fb5d84064ceb1c7d393e (diff)
fixes #4555 (Задваиваются контакты протоколов, где есть кэш)
Diffstat (limited to 'protocols/JabberG/src/jabber_events.cpp')
-rw-r--r--protocols/JabberG/src/jabber_events.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/protocols/JabberG/src/jabber_events.cpp b/protocols/JabberG/src/jabber_events.cpp
index cf3c2f92a7..161cc4f427 100644
--- a/protocols/JabberG/src/jabber_events.cpp
+++ b/protocols/JabberG/src/jabber_events.cpp
@@ -29,6 +29,30 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "jabber_disco.h"
/////////////////////////////////////////////////////////////////////////////////////////
+// OnCacheInit - cache initialization
+
+void CJabberProto::OnCacheInit()
+{
+ for (auto &hContact : AccContacts()) {
+ m_bCacheInited = true;
+
+ SetContactOfflineStatus(hContact);
+
+ if (getByte(hContact, "IsTransport", 0)) {
+ ptrA jid(getUStringA(hContact, "jid"));
+ if (jid == nullptr)
+ continue;
+
+ char *resourcepos = strchr(jid, '/');
+ if (resourcepos != nullptr)
+ *resourcepos = '\0';
+
+ m_lstTransports.insert(mir_strdup(jid));
+ }
+ }
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
// OnContactDeleted - processes a contact deletion
bool CJabberProto::OnContactDeleted(MCONTACT hContact, uint32_t)