diff options
author | George Hazan <ghazan@miranda.im> | 2018-12-28 15:59:56 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-12-28 15:59:56 +0300 |
commit | 30ed9ea8b76aedb3c3c1ad253a3d45be9b4b638f (patch) | |
tree | 5c714a359d9dfc72dfef46e34b36a1b203828b0c /protocols/Icq10/src/utils.cpp | |
parent | bf902e3aa18387158d0593ae2ae57eaf0f35b8be (diff) |
fixes #1674 (Miranda doesn't receive messages from unknown contacts)
Diffstat (limited to 'protocols/Icq10/src/utils.cpp')
-rw-r--r-- | protocols/Icq10/src/utils.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/protocols/Icq10/src/utils.cpp b/protocols/Icq10/src/utils.cpp index 412484ebda..d80537a4bc 100644 --- a/protocols/Icq10/src/utils.cpp +++ b/protocols/Icq10/src/utils.cpp @@ -33,6 +33,27 @@ IcqCacheItem* CIcqProto::FindContactByUIN(DWORD dwUin) return m_arCache.find((IcqCacheItem*)&dwUin); } +MCONTACT CIcqProto::CreateContact(DWORD dwUin, bool bTemporary) +{ + auto *pCache = FindContactByUIN(dwUin); + if (pCache != nullptr) + return pCache->m_hContact; + + MCONTACT hContact = db_add_contact(); + Proto_AddToContact(hContact, m_szModuleName); + setDword(hContact, "UIN", dwUin); + pCache = new IcqCacheItem(dwUin, hContact); + { + mir_cslock l(m_csCache); + m_arCache.insert(pCache); + } + + if (bTemporary) + db_set_b(hContact, "CList", "NotOnList", 1); + + return hContact; +} + ///////////////////////////////////////////////////////////////////////////////////////// void CIcqProto::CalcHash(AsyncHttpRequest *pReq) |