diff options
author | George Hazan <ghazan@miranda.im> | 2020-10-14 18:09:29 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-10-14 18:09:29 +0300 |
commit | 5d93dcbd9d47bd83c6f7c5e2382e2e6cf2641f60 (patch) | |
tree | 162bc7146e7a0e57cfbe4e1eaf47a873155958ca /protocols/JabberG/src | |
parent | 4627d81b96900c508db360151b8eb84b6569a2cf (diff) |
Jabber: newly added contact has no Nick field
Diffstat (limited to 'protocols/JabberG/src')
-rw-r--r-- | protocols/JabberG/src/jabber_chat.cpp | 2 | ||||
-rwxr-xr-x | protocols/JabberG/src/jabber_misc.cpp | 3 | ||||
-rwxr-xr-x | protocols/JabberG/src/jabber_thread.cpp | 2 |
3 files changed, 5 insertions, 2 deletions
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp index 78756b8b6f..53cee242bc 100644 --- a/protocols/JabberG/src/jabber_chat.cpp +++ b/protocols/JabberG/src/jabber_chat.cpp @@ -1294,7 +1294,7 @@ static void sttLogListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK *g static void sttSendPrivateMessage(CJabberProto *ppro, JABBER_LIST_ITEM *item, const char *nick)
{
- MCONTACT hContact = ppro->DBCreateContact(MakeJid(item->jid, nick), nullptr, true, false);
+ MCONTACT hContact = ppro->DBCreateContact(MakeJid(item->jid, nick), nick, true, false);
if (hContact != 0) {
pResourceStatus r(item->findResource(nick));
if (r)
diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp index e652d46c40..a9cde3e955 100755 --- a/protocols/JabberG/src/jabber_misc.cpp +++ b/protocols/JabberG/src/jabber_misc.cpp @@ -85,6 +85,9 @@ MCONTACT CJabberProto::DBCreateContact(const char *jid, const char *nick, bool t setUString(hNewContact, "jid", szJid);
if (nick != nullptr && *nick != '\0')
setUString(hNewContact, "Nick", nick);
+ else
+ setUString(hNewContact, "Nick", ptrA(JabberNickFromJID(szJid)));
+
if (temporary)
Contact_RemoveFromList(hNewContact);
else
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index 2f1b96a73a..111ef69fb8 100755 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -984,7 +984,7 @@ DWORD JabberGetLastContactMessageTime(MCONTACT hContact) MCONTACT CJabberProto::CreateTemporaryContact(const char *szJid, JABBER_LIST_ITEM* chatItem)
{
if (chatItem == nullptr)
- return DBCreateContact(szJid, ptrA(JabberNickFromJID(szJid)), true, true);
+ return DBCreateContact(szJid, nullptr, true, true);
const char *p = strchr(szJid, '/');
if (p != nullptr && p[1] != '\0')
|