summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/JabberG/src/jabber_util.cpp')
-rw-r--r--protocols/JabberG/src/jabber_util.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp
index abef88e3f5..ccf4a8223b 100644
--- a/protocols/JabberG/src/jabber_util.cpp
+++ b/protocols/JabberG/src/jabber_util.cpp
@@ -71,10 +71,11 @@ TCHAR* __stdcall JabberNickFromJID(const TCHAR *jid)
if (jid == NULL)
return mir_tstrdup(_T(""));
- const TCHAR *p = _tcschr(jid, '@');
- if (p == NULL)
- p = _tcschr(jid, '/');
+ const TCHAR *p = _tcsrchr(jid, '/');
+ if (p != NULL)
+ return mir_tstrdup(p+1);
+ p = _tcschr(jid, '@');
return (p != NULL) ? mir_tstrndup(jid, p - jid) : mir_tstrdup(jid);
}