summaryrefslogtreecommitdiff
path: root/protocols/JabberG
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-06-10 18:15:55 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-06-10 18:15:55 +0000
commitf36117c31cd21ba5442be8fd1d7234b1e71380b2 (patch)
tree6a893545226a2f71485b3ae1a3bb76548a3ada96 /protocols/JabberG
parentc3da3167feb57fabd16cf5b0da116c4da5ec061c (diff)
that was a bad idea... default nick must be gotten from a bare jid, not from a resource
git-svn-id: http://svn.miranda-ng.org/main/trunk@16947 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG')
-rw-r--r--protocols/JabberG/src/jabber_util.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp
index df084380c7..cb50955c75 100644
--- a/protocols/JabberG/src/jabber_util.cpp
+++ b/protocols/JabberG/src/jabber_util.cpp
@@ -71,11 +71,10 @@ TCHAR* __stdcall JabberNickFromJID(const TCHAR *jid)
if (jid == NULL)
return mir_tstrdup(_T(""));
- const TCHAR *p = _tcsrchr(jid, '/');
- if (p != NULL)
- return mir_tstrdup(p+1);
+ const TCHAR *p = _tcschr(jid, '@');
+ if (p == NULL)
+ p = _tcschr(jid, '/');
- p = _tcschr(jid, '@');
return (p != NULL) ? mir_tstrndup(jid, p - jid) : mir_tstrdup(jid);
}