From c0569ec17ede7bf5dcdb5102810ad2d6153b603c Mon Sep 17 00:00:00 2001 From: Goraf <22941576+Goraf@users.noreply.github.com> Date: Thu, 18 Jan 2018 19:56:09 +0100 Subject: Gadu-Gadu: * force SSL and manual hosts * force keeping connection allive * send ping only once per minute * overwirte old servers list * version bump --- protocols/Gadu-Gadu/src/dialogs.cpp | 10 ++++++++-- protocols/Gadu-Gadu/src/gg.cpp | 8 ++++++++ protocols/Gadu-Gadu/src/gg.h | 6 +++--- protocols/Gadu-Gadu/src/gg_proto.cpp | 6 +++--- protocols/Gadu-Gadu/src/keepalive.cpp | 2 +- protocols/Gadu-Gadu/src/version.h | 2 +- 6 files changed, 24 insertions(+), 10 deletions(-) (limited to 'protocols') diff --git a/protocols/Gadu-Gadu/src/dialogs.cpp b/protocols/Gadu-Gadu/src/dialogs.cpp index ef0ec538a6..123f32b53e 100644 --- a/protocols/Gadu-Gadu/src/dialogs.cpp +++ b/protocols/Gadu-Gadu/src/dialogs.cpp @@ -585,8 +585,14 @@ static INT_PTR CALLBACK gg_advoptsdlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, CheckDlgButton(hwndDlg, IDC_MANUALHOST, gg->getByte(GG_KEY_MANUALHOST, GG_KEYDEF_MANUALHOST) ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, IDC_SSLCONN, gg->getByte(GG_KEY_SSLCONN, GG_KEYDEF_SSLCONN) ? BST_CHECKED : BST_UNCHECKED); - EnableWindow(GetDlgItem(hwndDlg, IDC_HOST), IsDlgButtonChecked(hwndDlg, IDC_MANUALHOST)); - EnableWindow(GetDlgItem(hwndDlg, IDC_PORT), IsDlgButtonChecked(hwndDlg, IDC_MANUALHOST)); + EnableWindow(GetDlgItem(hwndDlg, IDC_KEEPALIVE), false); + EnableWindow(GetDlgItem(hwndDlg, IDC_MANUALHOST), false); + EnableWindow(GetDlgItem(hwndDlg, IDC_SSLCONN), false); + + //EnableWindow(GetDlgItem(hwndDlg, IDC_HOST), IsDlgButtonChecked(hwndDlg, IDC_MANUALHOST)); + //EnableWindow(GetDlgItem(hwndDlg, IDC_PORT), IsDlgButtonChecked(hwndDlg, IDC_MANUALHOST)); + EnableWindow(GetDlgItem(hwndDlg, IDC_HOST), false); + EnableWindow(GetDlgItem(hwndDlg, IDC_PORT), false); CheckDlgButton(hwndDlg, IDC_DIRECTCONNS, gg->getByte(GG_KEY_DIRECTCONNS, GG_KEYDEF_DIRECTCONNS) ? BST_CHECKED : BST_UNCHECKED); if (num = gg->getWord(GG_KEY_DIRECTPORT, GG_KEYDEF_DIRECTPORT)) diff --git a/protocols/Gadu-Gadu/src/gg.cpp b/protocols/Gadu-Gadu/src/gg.cpp index 52dfd08679..958d7a5bac 100644 --- a/protocols/Gadu-Gadu/src/gg.cpp +++ b/protocols/Gadu-Gadu/src/gg.cpp @@ -191,6 +191,14 @@ void GGPROTO::cleanuplastplugin(DWORD version) FindClose(hFind); } } + + //2. force SSL and keepalive; overwrite old server list; + if (version < PLUGIN_MAKE_VERSION(0, 11, 0, 4)) { + setString(GG_KEY_SERVERHOSTS, GG_KEYDEF_SERVERHOSTS); + setByte(GG_KEY_MANUALHOST, 1); + setByte(GG_KEY_SSLCONN, 1); + setByte(GG_KEY_KEEPALIVE, 1); + } } ////////////////////////////////////////////////////////// diff --git a/protocols/Gadu-Gadu/src/gg.h b/protocols/Gadu-Gadu/src/gg.h index 201fb8cf58..2a2bc879a4 100644 --- a/protocols/Gadu-Gadu/src/gg.h +++ b/protocols/Gadu-Gadu/src/gg.h @@ -209,11 +209,11 @@ struct GGGETAVATARDATA #define GG_KEYDEF_MSGACK 1 #define GG_KEY_MANUALHOST "ManualHost" // Specify by hand server host/port -#define GG_KEYDEF_MANUALHOST 0 +#define GG_KEYDEF_MANUALHOST 1 #define GG_KEY_SSLCONN "SSLConnection" // Use SSL/TLS for connections -#define GG_KEYDEF_SSLCONN 0 +#define GG_KEYDEF_SSLCONN 1 #define GG_KEY_SERVERHOSTS "ServerHosts" // NL separated list of hosts for server connection -#define GG_KEYDEF_SERVERHOSTS "91.197.13.54\r\n91.197.13.66\r\n91.197.13.69\r\n91.197.13.72\r\n91.197.13.75\r\n91.197.13.81" +#define GG_KEYDEF_SERVERHOSTS "91.214.237.108\r\n91.214.237.112\r\n91.214.237.116\r\n91.214.237.120\r\n91.214.237.123" #define GG_KEY_CLIENTIP "IP" // Contact IP (by notify) #define GG_KEY_CLIENTPORT "ClientPort" // Contact port diff --git a/protocols/Gadu-Gadu/src/gg_proto.cpp b/protocols/Gadu-Gadu/src/gg_proto.cpp index 17b2dfd80d..74bfcbd60a 100644 --- a/protocols/Gadu-Gadu/src/gg_proto.cpp +++ b/protocols/Gadu-Gadu/src/gg_proto.cpp @@ -70,9 +70,9 @@ GGPROTO::GGPROTO(const char *pszProtoName, const wchar_t *tszUserName) : mir_snwprintf(szPath, L"%s\\%s\\ImageCache", (wchar_t*)VARSW(L"%miranda_userdata%"), m_tszUserName); hImagesFolder = FoldersRegisterCustomPathT(LPGEN("Images"), m_szModuleName, szPath, m_tszUserName); - DWORD dwVersion; - if ((dwVersion = getDword(GG_PLUGINVERSION, 0)) < pluginInfo.version) - cleanuplastplugin(dwVersion); + DWORD pluginVersion = getDword(GG_PLUGINVERSION, 0); + if (pluginVersion < pluginInfo.version) + cleanuplastplugin(pluginVersion); links_instance_init(); initavatarrequestthread(); diff --git a/protocols/Gadu-Gadu/src/keepalive.cpp b/protocols/Gadu-Gadu/src/keepalive.cpp index ef937e06b3..f6b70dd07f 100644 --- a/protocols/Gadu-Gadu/src/keepalive.cpp +++ b/protocols/Gadu-Gadu/src/keepalive.cpp @@ -61,7 +61,7 @@ void GGPROTO::keepalive_init() #ifdef DEBUGMODE debugLogA("keepalive_init(): Initializing Timer %d", i); #endif - timer = SetTimer(nullptr, 0, 1000 * 30, gg_keepalive); + timer = SetTimer(nullptr, 0, 1000 * 60, gg_keepalive); g_timers[i] = this; } } diff --git a/protocols/Gadu-Gadu/src/version.h b/protocols/Gadu-Gadu/src/version.h index 87f697f4fc..0bb38454da 100644 --- a/protocols/Gadu-Gadu/src/version.h +++ b/protocols/Gadu-Gadu/src/version.h @@ -21,7 +21,7 @@ #define __MAJOR_VERSION 0 #define __MINOR_VERSION 11 #define __RELEASE_NUM 0 -#define __BUILD_NUM 3 +#define __BUILD_NUM 4 #include -- cgit v1.2.3