diff options
author | George Hazan <ghazan@miranda.im> | 2021-04-25 20:22:00 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2021-04-25 20:22:00 +0300 |
commit | 6e2c04c2c7ea221afb58e71f6e99f2d0ed1c7781 (patch) | |
tree | db5fb61a368684b9656087096bb4ebc14251ffa4 /src | |
parent | 7ae04023cd92e37c3d3a7d8752dc5e76818ca8d7 (diff) |
suddenly: major crutch to handle WhatsApp groupchats history
Diffstat (limited to 'src')
-rw-r--r-- | src/mir_app/src/chat_manager.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mir_app/src/chat_manager.cpp b/src/mir_app/src/chat_manager.cpp index b7f7001ae0..0a89030837 100644 --- a/src/mir_app/src/chat_manager.cpp +++ b/src/mir_app/src/chat_manager.cpp @@ -713,15 +713,15 @@ USERINFO* UM_AddUser(SESSION_INFO *si, const wchar_t *pszUID, const wchar_t *psz return nullptr;
auto *pUser = UM_FindUser(si, pszUID);
- if (pUser)
- return pUser;
-
- pUser = new USERINFO();
- pUser->pszUID = mir_wstrdup(pszUID);
- pUser->pszNick = mir_wstrdup(pszNick);
+ if (pUser == nullptr) {
+ pUser = new USERINFO();
+ si->getKeyList().insert(pUser);
+ si->getUserList().insert(pUser);
+ }
+
+ replaceStrW(pUser->pszUID, pszUID);
+ replaceStrW(pUser->pszNick, pszNick);
pUser->Status = wStatus;
- si->getKeyList().insert(pUser);
- si->getUserList().insert(pUser);
return pUser;
}
|