diff options
author | George Hazan <ghazan@miranda.im> | 2018-04-13 12:13:40 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-04-13 12:13:40 +0300 |
commit | ba00e60921f9a63a2b6157fc10a98f4db99aaa6b (patch) | |
tree | c71c646208357492fe30b17b1fad8c9212665cca /protocols/Discord | |
parent | 58b9cd3d8edda8e0b94b802aa2e4bb0d36adb11b (diff) |
fixes #1262 ([Discord] Database migration causes duplication of discord contacts)
Diffstat (limited to 'protocols/Discord')
-rw-r--r-- | protocols/Discord/src/proto.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/protocols/Discord/src/proto.cpp b/protocols/Discord/src/proto.cpp index b4207c66f0..c3cd1eda57 100644 --- a/protocols/Discord/src/proto.cpp +++ b/protocols/Discord/src/proto.cpp @@ -64,17 +64,6 @@ CDiscordProto::CDiscordProto(const char *proto_name, const wchar_t *username) : // database db_set_resident(m_szModuleName, "XStatusMsg"); - // Fill users list - for (auto &hContact : AccContacts()) { - CDiscordUser *pNew = new CDiscordUser(getId(hContact, DB_KEY_ID)); - pNew->hContact = hContact; - pNew->channelId = getId(hContact, DB_KEY_CHANNELID); - pNew->lastMsg.id = getId(hContact, DB_KEY_LASTMSGID); - pNew->wszUsername = ptrW(getWStringA(hContact, DB_KEY_NICK)); - pNew->iDiscriminator = getDword(hContact, DB_KEY_DISCR); - arUsers.insert(pNew); - } - // Network initialization CMStringW descr; NETLIBUSER nlu = {}; @@ -562,6 +551,17 @@ HANDLE CDiscordProto::SendFile(MCONTACT hContact, const wchar_t *szDescription, int CDiscordProto::OnModulesLoaded(WPARAM, LPARAM) { + // Fill users list + for (auto &hContact : AccContacts()) { + CDiscordUser *pNew = new CDiscordUser(getId(hContact, DB_KEY_ID)); + pNew->hContact = hContact; + pNew->channelId = getId(hContact, DB_KEY_CHANNELID); + pNew->lastMsg.id = getId(hContact, DB_KEY_LASTMSGID); + pNew->wszUsername = ptrW(getWStringA(hContact, DB_KEY_NICK)); + pNew->iDiscriminator = getDword(hContact, DB_KEY_DISCR); + arUsers.insert(pNew); + } + GCREGISTER gcr = {}; gcr.dwFlags = GC_TYPNOTIF | GC_CHANMGR; gcr.ptszDispName = m_tszUserName; |