diff options
-rw-r--r-- | protocols/Sametime/src/sametime_proto.h | 1 | ||||
-rw-r--r-- | protocols/Sametime/src/sametime_session.cpp | 27 | ||||
-rw-r--r-- | protocols/Sametime/src/version.h | 4 |
3 files changed, 24 insertions, 8 deletions
diff --git a/protocols/Sametime/src/sametime_proto.h b/protocols/Sametime/src/sametime_proto.h index 35082ecd23..7b51b77476 100644 --- a/protocols/Sametime/src/sametime_proto.h +++ b/protocols/Sametime/src/sametime_proto.h @@ -113,6 +113,7 @@ struct CSametimeProto : public PROTO<CSametimeProto> void InitSessionMenu();
int LogIn(int status, HANDLE hNetlibUser);
int LogOut();
+ int OnLogInRedirect(char* newHost);
int SetSessionStatus(int status);
void UpdateSelfStatus();
int SetIdle(bool idle);
diff --git a/protocols/Sametime/src/sametime_session.cpp b/protocols/Sametime/src/sametime_session.cpp index a0e6eb8bdf..37bff64a3c 100644 --- a/protocols/Sametime/src/sametime_session.cpp +++ b/protocols/Sametime/src/sametime_session.cpp @@ -113,14 +113,10 @@ void __cdecl SessionStateChange(mwSession* session, mwSessionState state, gpoint break;
case mwSession_STOPPED:
- break;
+
case mwSession_LOGIN_REDIR:
- proto->debugLog(_T("SessionStateChange() mwSession_LOGIN_REDIR info=[%s]"), _A2T((char*)info));
- //options.server_name = str((char*)info);
- mir_strcpy(proto->options.server_name, (char*)info);
- proto->LogOut();
- proto->LogIn(proto->login_status, proto->m_hNetlibUser);
+ proto->OnLogInRedirect((char*)info);
break;
case mwSession_LOGIN_CONT:
@@ -521,6 +517,25 @@ int CSametimeProto::LogOut() return 0;
}
+int CSametimeProto::OnLogInRedirect(char* newHost)
+{
+ debugLog(_T("OnLogInRedirect() mwSession_LOGIN_REDIR newHost=[%s]"), _A2T(newHost));
+
+ if (!newHost || !mir_strcmp(newHost, options.server_name) || db_get_b(0, m_szModuleName, "ForceLogin", 0) == 1) {
+ debugLog(_T("OnLogInRedirect() forceLogin"));
+ mwSession_forceLogin(session);
+ return 0;
+ }
+
+ debugLog(_T("OnLogInRedirect() redirect"));
+ mir_strcpy(options.server_name, newHost);
+ LogOut();
+ Sleep(50); //wait for SessionThread end
+ LogIn(login_status, m_hNetlibUser);
+ return 0;
+
+}
+
void CSametimeProto::InitAwayMsg()
{
AwayMessages.szOnline = 0;
diff --git a/protocols/Sametime/src/version.h b/protocols/Sametime/src/version.h index 8e4ec7c6c6..eac0e4cf48 100644 --- a/protocols/Sametime/src/version.h +++ b/protocols/Sametime/src/version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 0
#define __MINOR_VERSION 7
#define __RELEASE_NUM 0
-#define __BUILD_NUM 0
+#define __BUILD_NUM 3
#include <stdver.h>
@@ -10,5 +10,5 @@ #define __DESCRIPTION "Implementation of instant messaging for the Lotus Sametime protocol."
#define __AUTHOR "Scott Ellis, Szymon Tokarz"
#define __AUTHOREMAIL "mail"/*antispam*/"@"/*antispam*/"scottellis.com.au, wsx22"/*antispam*/"@"/*antispam*/"o2.pl"
-#define __COPYRIGHT "© 2005 Scott Ellis, 2014 wsx22"
+#define __COPYRIGHT "© 2005 Scott Ellis, 2014-2016 wsx22"
#define __AUTHORWEB "http://miranda-ng.org/p/Sametime/"
|