summaryrefslogtreecommitdiff
path: root/protocols/JabberG
diff options
context:
space:
mode:
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);
}