diff options
-rw-r--r-- | protocols/JabberG/src/jabber.h | 29 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_util.cpp | 11 |
2 files changed, 16 insertions, 24 deletions
diff --git a/protocols/JabberG/src/jabber.h b/protocols/JabberG/src/jabber.h index a370de37f5..899d38db96 100644 --- a/protocols/JabberG/src/jabber.h +++ b/protocols/JabberG/src/jabber.h @@ -366,22 +366,23 @@ struct ThreadData MCONTACT resolveContact;
// features & registration
- HWND reg_hwndDlg;
- BOOL reg_done, bIsSessionAvailable;
- class TJabberAuth* auth;
- JabberCapsBits jabberServerCaps;
- BOOL bBookmarksLoaded;
- DWORD dwLoginRqs;
+ HWND reg_hwndDlg;
+ BOOL reg_done, bIsSessionAvailable;
+ BOOL bBookmarksLoaded;
+ DWORD dwLoginRqs;
// connection & login data
- TCHAR username[512];
- TCHAR password[512];
- char server[128];
- char manualHost[128];
- TCHAR resource[128];
- TCHAR fullJID[JABBER_MAX_JID_LEN];
- WORD port;
- ptrT tszNewPassword;
+ TCHAR username[512];
+ TCHAR password[512];
+ char server[128];
+ char manualHost[128];
+ TCHAR resource[128];
+ TCHAR fullJID[JABBER_MAX_JID_LEN];
+ WORD port;
+ ptrT tszNewPassword;
+
+ class TJabberAuth* auth;
+ JabberCapsBits jabberServerCaps;
void close(void);
void shutdown(void);
diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp index 2b37a1c864..d9a5a0695e 100644 --- a/protocols/JabberG/src/jabber_util.cpp +++ b/protocols/JabberG/src/jabber_util.cpp @@ -98,19 +98,10 @@ TCHAR* __stdcall JabberNickFromJID(const TCHAR *jid) return mir_tstrdup(_T(""));
const TCHAR *p;
- TCHAR *nick;
-
if ((p = _tcschr(jid, '@')) == NULL)
p = _tcschr(jid, '/');
- if (p != NULL) {
- if ((nick = (TCHAR*)mir_alloc(sizeof(TCHAR)*(int(p - jid) + 1))) != NULL) {
- _tcsncpy_s(nick, p - jid, jid, _TRUNCATE);
- nick[p - jid] = '\0';
- }
- }
- else nick = mir_tstrdup(jid);
- return nick;
+ return (p != NULL) ? mir_tstrndup(jid, p - jid) : mir_tstrdup(jid);
}
pResourceStatus CJabberProto::ResourceInfoFromJID(const TCHAR *jid)
|