diff options
-rw-r--r-- | protocols/WhatsApp/src/avatars.cpp | 4 | ||||
-rw-r--r-- | protocols/WhatsApp/src/db.h | 2 | ||||
-rw-r--r-- | protocols/WhatsApp/src/iq.cpp | 2 | ||||
-rw-r--r-- | protocols/WhatsApp/src/main.cpp | 2 | ||||
-rw-r--r-- | protocols/WhatsApp/src/proto.cpp | 8 | ||||
-rw-r--r-- | protocols/WhatsApp/src/utils.cpp | 2 |
6 files changed, 10 insertions, 10 deletions
diff --git a/protocols/WhatsApp/src/avatars.cpp b/protocols/WhatsApp/src/avatars.cpp index 09a693a0d0..f7f97de7ea 100644 --- a/protocols/WhatsApp/src/avatars.cpp +++ b/protocols/WhatsApp/src/avatars.cpp @@ -44,7 +44,7 @@ INT_PTR WhatsAppProto::GetAvatarInfo(WPARAM wParam, LPARAM lParam) { PROTO_AVATAR_INFORMATION *pai = (PROTO_AVATAR_INFORMATION*)lParam; - ptrA id(getStringA(pai->hContact, isChatRoom(pai->hContact) ? "ChatRoomID" : DBKEY_JID)); + ptrA id(getStringA(pai->hContact, isChatRoom(pai->hContact) ? "ChatRoomID" : DBKEY_ID)); if (id == NULL) return GAIR_NOAVATAR; @@ -92,7 +92,7 @@ CMStringW WhatsAppProto::GetAvatarFileName(MCONTACT hContact) CMStringA jid; if (hContact != NULL) { - ptrA szId(getStringA(hContact, isChatRoom(hContact) ? "ChatRoomID" : DBKEY_JID)); + ptrA szId(getStringA(hContact, isChatRoom(hContact) ? "ChatRoomID" : DBKEY_ID)); if (szId == NULL) return L""; diff --git a/protocols/WhatsApp/src/db.h b/protocols/WhatsApp/src/db.h index 164f2f5fe1..cb562715f4 100644 --- a/protocols/WhatsApp/src/db.h +++ b/protocols/WhatsApp/src/db.h @@ -8,7 +8,7 @@ Copyright © 2019-22 George Hazan #define MODULENAME "WhatsApp" // DB keys -#define DBKEY_JID "jid" +#define DBKEY_ID "ID" #define DBKEY_DEVICE_ID "DeviceId" #define DBKEY_EPHEMERAL_TS "EphemeralTS" #define DBKEY_EPHEMERAL_EXPIRE "EphemeralExpire" diff --git a/protocols/WhatsApp/src/iq.cpp b/protocols/WhatsApp/src/iq.cpp index 255682ad81..cbcd8f509d 100644 --- a/protocols/WhatsApp/src/iq.cpp +++ b/protocols/WhatsApp/src/iq.cpp @@ -340,7 +340,7 @@ void WhatsAppProto::OnIqPairSuccess(const WANode &node) if (auto *pszJid = pDevice->getAttr("jid")) { WAJid jid(pszJid); m_szJid = jid.user + "@" + jid.server; - setUString(DBKEY_JID, m_szJid); + setUString(DBKEY_ID, m_szJid); setDword(DBKEY_DEVICE_ID, jid.device); } } diff --git a/protocols/WhatsApp/src/main.cpp b/protocols/WhatsApp/src/main.cpp index 7c0e54ba22..4d8fc05d26 100644 --- a/protocols/WhatsApp/src/main.cpp +++ b/protocols/WhatsApp/src/main.cpp @@ -38,7 +38,7 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOC CMPlugin::CMPlugin() : ACCPROTOPLUGIN<WhatsAppProto>(MODULENAME, pluginInfo) { - SetUniqueId(DBKEY_JID); + SetUniqueId(DBKEY_ID); } ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/protocols/WhatsApp/src/proto.cpp b/protocols/WhatsApp/src/proto.cpp index 0b6fab3b19..e04c2b253f 100644 --- a/protocols/WhatsApp/src/proto.cpp +++ b/protocols/WhatsApp/src/proto.cpp @@ -36,7 +36,7 @@ WhatsAppProto::WhatsAppProto(const char *proto_name, const wchar_t *username) : PROTO<WhatsAppProto>(proto_name, username), m_impl(*this), m_signalStore(this, ""), - m_szJid(getMStringA(DBKEY_JID)), + m_szJid(getMStringA(DBKEY_ID)), m_tszDefaultGroup(getWStringA(DBKEY_DEF_GROUP)), m_arUsers(10, CompareUsers), m_arDevices(1), @@ -111,7 +111,7 @@ void WhatsAppProto::OnModulesLoaded() for (auto &cc : AccContacts()) { bool bIsChat = isChatRoom(cc); - CMStringA szId(getMStringA(cc, bIsChat ? "ChatRoomID" : DBKEY_JID)); + CMStringA szId(getMStringA(cc, bIsChat ? "ChatRoomID" : DBKEY_ID)); if (!szId.IsEmpty()) m_arUsers.insert(new WAUser(cc, szId, bIsChat)); } @@ -230,7 +230,7 @@ void WhatsAppProto::OnSendMessage(const JSONNode &node, void*) int WhatsAppProto::SendMsg(MCONTACT hContact, int, const char *pszMsg) { - ptrA jid(getStringA(hContact, DBKEY_JID)); + ptrA jid(getStringA(hContact, DBKEY_ID)); if (jid == nullptr || pszMsg == nullptr) return 0; @@ -272,7 +272,7 @@ int WhatsAppProto::SendMsg(MCONTACT hContact, int, const char *pszMsg) int WhatsAppProto::UserIsTyping(MCONTACT hContact, int) { if (hContact && isOnline()) { - ptrA jid(getStringA(hContact, DBKEY_JID)); + ptrA jid(getStringA(hContact, DBKEY_ID)); if (jid && isOnline()) { } } diff --git a/protocols/WhatsApp/src/utils.cpp b/protocols/WhatsApp/src/utils.cpp index debfa43f42..455428bd7b 100644 --- a/protocols/WhatsApp/src/utils.cpp +++ b/protocols/WhatsApp/src/utils.cpp @@ -94,7 +94,7 @@ WAUser* WhatsAppProto::AddUser(const char *szId, bool bTemporary, bool isChat) setString(hContact, "ChatRoomID", szId); } else { - setString(hContact, DBKEY_JID, szId); + setString(hContact, DBKEY_ID, szId); if (m_wszDefaultGroup) Clist_SetGroup(hContact, m_wszDefaultGroup); } |