From f36117c31cd21ba5442be8fd1d7234b1e71380b2 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 10 Jun 2016 18:15:55 +0000 Subject: 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 --- protocols/JabberG/src/jabber_util.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'protocols') 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); } -- cgit v1.2.3