summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_list.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-03-16 14:57:07 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-03-16 14:57:07 +0300
commitecee3cf571be168342936201457d00d094239a80 (patch)
tree06b3d401c7a1a76622c05b1b08d5fb33ae0aa324 /protocols/JabberG/src/jabber_list.cpp
parent93e78f0795929ac87f4b85ffc9af077b257dbcda (diff)
Jabber:
- useless parameter in CJabberProto::OnAddContactForever removed; - when we receive subscription = remove we just change it to SUB_NONE instead of removing contact from LIST_ROSTER; - code cleaning
Diffstat (limited to 'protocols/JabberG/src/jabber_list.cpp')
-rw-r--r--protocols/JabberG/src/jabber_list.cpp29
1 files changed, 14 insertions, 15 deletions
diff --git a/protocols/JabberG/src/jabber_list.cpp b/protocols/JabberG/src/jabber_list.cpp
index 8a4b817965..94ba7846e8 100644
--- a/protocols/JabberG/src/jabber_list.cpp
+++ b/protocols/JabberG/src/jabber_list.cpp
@@ -26,8 +26,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
#include "jabber_list.h"
-void MenuUpdateSrmmIcon(JABBER_LIST_ITEM *item);
-
/////////////////////////////////////////////////////////////////////////////////////////
// List item constructor & destructor
@@ -87,20 +85,21 @@ void JABBER_RESOURCE_STATUS::Release()
delete this;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
void CJabberProto::ListInit(void)
{
for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
- if (!isChatRoom(hContact)) continue;
- ptrW jid(getWStringA(hContact, "ChatRoomID"));
- if (jid != nullptr)
- ListAdd(LIST_CHATROOM, jid, hContact);
- }
-
- for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
- if (isChatRoom(hContact)) continue;
- ptrW jid(getWStringA(hContact, "jid"));
- if (jid != nullptr)
- ListAdd(LIST_ROSTER, jid, hContact);
+ if (isChatRoom(hContact)) {
+ ptrW jid(getWStringA(hContact, "ChatRoomID"));
+ if (jid != nullptr)
+ ListAdd(LIST_CHATROOM, jid, hContact);
+ }
+ else {
+ ptrW jid(getWStringA(hContact, "jid"));
+ if (jid != nullptr)
+ ListAdd(LIST_ROSTER, jid, hContact);
+ }
}
}
@@ -130,8 +129,8 @@ JABBER_LIST_ITEM* CJabberProto::ListAdd(JABBER_LIST list, const wchar_t *jid, MC
wchar_t *s = mir_wstrdup(jid);
wchar_t *q = nullptr;
+
// strip resource name if any
- //fyr
if (!((list == LIST_ROSTER) && ListGetItemPtr(LIST_CHATROOM, jid))) { // but only if it is not chat room contact
if (list != LIST_VCARD_TEMP) {
wchar_t *p;
@@ -143,7 +142,7 @@ JABBER_LIST_ITEM* CJabberProto::ListAdd(JABBER_LIST list, const wchar_t *jid, MC
else bUseResource = true;
if (!bUseResource && list == LIST_ROSTER) {
- //if it is a chat room keep resource and made it resource sensitive
+ // if it is a chat room keep resource and made it resource sensitive
if (ChatRoomHContactFromJID(s)) {
if (q != nullptr)
*q = '/';