From 6f03a0bf158226db5e50e099786a09ba4894a393 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 21 Apr 2016 12:46:33 +0000 Subject: - fix for a chat room processing in roster; - fix for a default chat room's nick git-svn-id: http://svn.miranda-ng.org/main/trunk@16733 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/JabberG/src/jabber_iqid.cpp | 3 --- protocols/JabberG/src/jabber_proto.cpp | 9 ++++++++- protocols/JabberG/src/jabber_util.cpp | 7 ++++--- 3 files changed, 12 insertions(+), 7 deletions(-) (limited to 'protocols') diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp index 420e0561b8..5bd0913292 100644 --- a/protocols/JabberG/src/jabber_iqid.cpp +++ b/protocols/JabberG/src/jabber_iqid.cpp @@ -1011,9 +1011,6 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) } if (!hasFn) delSetting(hContact, "FullName"); - // We are not deleting "Nick" - // if (!hasNick) - // delSetting(hContact, "Nick"); if (!hasGiven) delSetting(hContact, "FirstName"); if (!hasFamily) diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index 57025c09b5..67b6c4bd22 100644 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -241,11 +241,18 @@ int CJabberProto::OnModulesLoadedEx(WPARAM, LPARAM) for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { SetContactOfflineStatus(hContact); + if (isChatRoom(hContact)) { + ptrT jid(getTStringA(hContact, "ChatRoomID")); + if (jid != NULL) + ListAdd(LIST_CHATROOM, jid, hContact); + continue; + } + ptrT jid(getTStringA(hContact, "jid")); if (jid == NULL) continue; - ListAdd(isChatRoom(hContact) ? LIST_CHATROOM : LIST_ROSTER, jid, hContact); + ListAdd(LIST_ROSTER, jid, hContact); TCHAR *resourcepos = _tcschr(jid, '/'); if (resourcepos != NULL) diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp index abef88e3f5..ccf4a8223b 100644 --- a/protocols/JabberG/src/jabber_util.cpp +++ b/protocols/JabberG/src/jabber_util.cpp @@ -71,10 +71,11 @@ TCHAR* __stdcall JabberNickFromJID(const TCHAR *jid) if (jid == NULL) return mir_tstrdup(_T("")); - const TCHAR *p = _tcschr(jid, '@'); - if (p == NULL) - p = _tcschr(jid, '/'); + const TCHAR *p = _tcsrchr(jid, '/'); + if (p != NULL) + return mir_tstrdup(p+1); + p = _tcschr(jid, '@'); return (p != NULL) ? mir_tstrndup(jid, p - jid) : mir_tstrdup(jid); } -- cgit v1.2.3