diff options
author | George Hazan <george.hazan@gmail.com> | 2016-06-22 16:42:00 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-06-22 16:42:00 +0000 |
commit | 5ee4c727a1a585172eb8973337fb28c8e88098cf (patch) | |
tree | 76e52c1d93790db4c9276bdc7b3accc55321b9f6 /protocols/JabberG/src/jabber_misc.cpp | |
parent | 937c816460e09bf4da2d4fbf6ca5c4b18346ee19 (diff) |
another implementation of roster items' sorting
git-svn-id: http://svn.miranda-ng.org/main/trunk@17017 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG/src/jabber_misc.cpp')
-rw-r--r-- | protocols/JabberG/src/jabber_misc.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp index 83dd08c586..a7a1c46562 100644 --- a/protocols/JabberG/src/jabber_misc.cpp +++ b/protocols/JabberG/src/jabber_misc.cpp @@ -90,15 +90,12 @@ MCONTACT CJabberProto::DBCreateContact(const TCHAR *jid, const TCHAR *nick, bool if (jid == NULL || jid[0] == '\0')
return NULL;
- TCHAR *s = NEWTSTR_ALLOCA(jid);
- TCHAR *q = NULL;
// strip resource if present
- if (TCHAR *p = _tcschr(s, '@'))
- if ((q = _tcschr(p, '/')) != NULL)
- *q = '\0';
-
- if (!stripResource && q != NULL) // so that resource is not stripped
- *q = '/';
+ TCHAR *s = NEWTSTR_ALLOCA(jid), *pResource = NULL;
+ if (stripResource)
+ if (TCHAR *p = _tcschr(s, '@'))
+ if (pResource = _tcschr(p, '/'))
+ *pResource = '\0';
// We can't use JabberHContactFromJID() here because of the stripResource option
size_t len = mir_tstrlen(s);
@@ -123,7 +120,7 @@ MCONTACT CJabberProto::DBCreateContact(const TCHAR *jid, const TCHAR *nick, bool SendGetVcard(s);
if (JABBER_LIST_ITEM *pItem = ListAdd(LIST_ROSTER, jid, hNewContact))
- pItem->bUseResource = !stripResource;
+ pItem->bUseResource = pResource != NULL;
debugLog(_T("Create Jabber contact jid=%s, nick=%s"), s, nick);
DBCheckIsTransportedContact(s, hNewContact);
|