summaryrefslogtreecommitdiff
path: root/plugins/StatusPlugins/KeepStatus
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/StatusPlugins/KeepStatus')
-rw-r--r--plugins/StatusPlugins/KeepStatus/keepstatus.cpp33
-rw-r--r--plugins/StatusPlugins/KeepStatus/keepstatus.h1
-rw-r--r--plugins/StatusPlugins/KeepStatus/version.h56
3 files changed, 40 insertions, 50 deletions
diff --git a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp
index 1e710ba312..6402c42a0f 100644
--- a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp
+++ b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp
@@ -253,14 +253,13 @@ static int GetStatus(const TConnectionSettings& cs)
static int SetCurrentStatus()
{
- int realStatus;
PROTOCOLSETTINGEX **ps = GetCurrentProtoSettingsCopy();
for (int i=0; i < connectionSettings.getCount(); i++) {
- realStatus = CallProtoService(ps[i]->szName, PS_GETSTATUS, 0, 0);
- if ( (ps[i]->status == ID_STATUS_DISABLED) || (ps[i]->status == realStatus) || ( db_get_b(NULL, ps[i]->szName, SETTING_PROTORETRY, 0))) { // ignore this proto by removing it's name (not so nice)
+ int realStatus = CallProtoService(ps[i]->szName, PS_GETSTATUS, 0, 0);
+ if (ps[i]->status == ID_STATUS_DISABLED || ps[i]->status == realStatus) { // ignore this proto by removing it's name (not so nice)
ps[i]->szName = "";
}
- else if ( (ps[i]->status != ID_STATUS_DISABLED) && (ps[i]->status != realStatus) && (realStatus != ID_STATUS_OFFLINE) && ( db_get_b(NULL, MODULENAME, SETTING_FIRSTOFFLINE, FALSE))) {
+ else if ((ps[i]->status != ID_STATUS_DISABLED) && (ps[i]->status != realStatus) && (realStatus != ID_STATUS_OFFLINE) && (db_get_b(NULL, MODULENAME, SETTING_FIRSTOFFLINE, FALSE))) {
// force offline before reconnecting
log_infoA("KeepStatus: Setting %s offline before making a new connection attempt", ps[i]->szName);
CallProtoService(ps[i]->szName, PS_SETSTATUS, (WPARAM)ID_STATUS_OFFLINE, 0);
@@ -524,7 +523,7 @@ static int ProcessProtoAck(WPARAM,LPARAM lParam)
{
ACKDATA *ack=(ACKDATA*)lParam;
- if ( (ack->type != ACKTYPE_STATUS) && (ack->type != ACKTYPE_LOGIN))
+ if (ack->type != ACKTYPE_STATUS && ack->type != ACKTYPE_LOGIN)
return 0;
char dbSetting[128];
@@ -532,15 +531,10 @@ static int ProcessProtoAck(WPARAM,LPARAM lParam)
if (!db_get_b(NULL, MODULENAME, dbSetting, 1))
return 0;
- if ( db_get_b(NULL, ack->szModule, SETTING_PROTORETRY, 0)) {
- log_infoA("KeepStatus: %s has built-in reconnection enabled", ack->szModule);
- return 0;
- }
-
- if ( ack->type == ACKTYPE_STATUS && ack->result == ACKRESULT_SUCCESS ) {
- for (int i=0; i < connectionSettings.getCount(); i++ ) {
+ if (ack->type == ACKTYPE_STATUS && ack->result == ACKRESULT_SUCCESS) {
+ for (int i = 0; i < connectionSettings.getCount(); i++) {
TConnectionSettings& cs = connectionSettings[i];
- if ( !strcmp( cs.szName, ack->szModule ))
+ if (!strcmp(cs.szName, ack->szModule))
cs.lastStatusAckTime = GetTickCount();
}
StartTimer(IDT_PROCESSACK, 0, FALSE);
@@ -549,14 +543,13 @@ static int ProcessProtoAck(WPARAM,LPARAM lParam)
if (ack->type == ACKTYPE_LOGIN) {
if (ack->lParam == LOGINERR_OTHERLOCATION) {
-
- for (int i=0;i<connectionSettings.getCount();i++) {
+ for (int i=0; i < connectionSettings.getCount(); i++) {
TConnectionSettings& cs = connectionSettings[i];
if (!strcmp(ack->szModule, cs.szName)) {
AssignStatus(&cs, ID_STATUS_OFFLINE, 0, NULL);
- if ( db_get_b(NULL, MODULENAME, SETTING_CNCOTHERLOC, 0)) {
+ if (db_get_b(NULL, MODULENAME, SETTING_CNCOTHERLOC, 0)) {
StopTimer(IDT_PROCESSACK);
- for (int j=0;j<connectionSettings.getCount();j++) {
+ for (int j = 0; j < connectionSettings.getCount(); j++) {
AssignStatus(&connectionSettings[j], ID_STATUS_OFFLINE, 0, NULL);
}
}
@@ -573,7 +566,7 @@ static int ProcessProtoAck(WPARAM,LPARAM lParam)
case LOGINERR_CANCEL:
{
log_infoA("KeepStatus: cancel on login error (%s)", ack->szModule);
- for ( int i=0; i <connectionSettings.getCount(); i++ ) {
+ for (int i = 0; i < connectionSettings.getCount(); i++) {
TConnectionSettings& cs = connectionSettings[i];
if (!strcmp(ack->szModule, cs.szName))
AssignStatus(&cs, ID_STATUS_OFFLINE, 0, NULL);
@@ -607,7 +600,7 @@ static VOID CALLBACK CheckConnectingTimer(HWND hwnd,UINT message,UINT_PTR idEven
StopTimer(IDT_CHECKCONNECTING);
//log_debugA("KeepStatus: CheckConnectingTimer");
- for (int i=0;i<connectionSettings.getCount();i++) {
+ for (int i=0; i < connectionSettings.getCount(); i++) {
TConnectionSettings& cs = connectionSettings[i];
int curStatus = GetStatus(cs);
@@ -631,7 +624,7 @@ static VOID CALLBACK CheckAckStatusTimer(HWND hwnd,UINT message,UINT_PTR idEvent
bool needChecking = false;
StopTimer(IDT_PROCESSACK);
- for (int i=0;i<connectionSettings.getCount();i++) {
+ for (int i=0; i < connectionSettings.getCount(); i++) {
TConnectionSettings& cs = connectionSettings[i];
int curStatus = GetStatus(cs);
diff --git a/plugins/StatusPlugins/KeepStatus/keepstatus.h b/plugins/StatusPlugins/KeepStatus/keepstatus.h
index 0bcadaa66a..9df88b36bb 100644
--- a/plugins/StatusPlugins/KeepStatus/keepstatus.h
+++ b/plugins/StatusPlugins/KeepStatus/keepstatus.h
@@ -53,7 +53,6 @@
#define SETTING_PINGCOUNT "PingCount"
#define DEFAULT_PINGCOUNT 1
#define SETTING_CNTDELAY "CntDelay"
-#define SETTING_PROTORETRY "Retry" // IRC setting
#define STATUSCHANGEDELAY 500 // ms
#define DEFAULT_MAXRETRIES 0
#define DEFAULT_INITDELAY 10 // s
diff --git a/plugins/StatusPlugins/KeepStatus/version.h b/plugins/StatusPlugins/KeepStatus/version.h
index b9cc47ae93..51754374b8 100644
--- a/plugins/StatusPlugins/KeepStatus/version.h
+++ b/plugins/StatusPlugins/KeepStatus/version.h
@@ -1,50 +1,48 @@
// plugin version part
-#define __MAJOR_VERSION 0
-#define __MINOR_VERSION 8
-#define __RELEASE_NUM 0
-#define __BUILD_NUM 97
+#define __MAJOR_VERSION 0
+#define __MINOR_VERSION 9
+#define __RELEASE_NUM 0
+#define __BUILD_NUM 1
// minimal MirandaIM version number, with which this plugin supposed to work
-#define __PROD_MAJOR_VERSION 0
-#define __PROD_MINOR_VERSION 8
-#define __PROD_RELEASE_NUM 0
-#define __PROD_BUILD_NUM 0
-// if your plugin works only with Miranda core beginning from specific revision, you can include this information in Product Version resource
-//#define __PROD_REV_NUM 1234
+#define __PROD_MAJOR_VERSION 0
+#define __PROD_MINOR_VERSION 8
+#define __PROD_RELEASE_NUM 0
+#define __PROD_BUILD_NUM 0
// stuff that will be used in PluginInfo section and in Version resource
-#define __PLUGIN_NAME "Keep status"
-#define __FILENAME "KeepStatus.dll"
-#define __DESC "KeepStatus, A connection checker, for use with (or without) StartupStatus and/or AdvancedAutoAway."
-#define __AUTHOR "P Boon"
-#define __AUTHOREMAIL "unregistered@users.sourceforge.net"
-#define __AUTHORWEB "http://miranda-ng.org/p/KeepStatus/"
-#define __COPYRIGHT "(c) 2003-08 P. Boon, 2008-10 George Hazan"
+#define __PLUGIN_NAME "Keep status"
+#define __FILENAME "KeepStatus.dll"
+#define __DESC "KeepStatus, A connection checker, for use with (or without) StartupStatus and/or AdvancedAutoAway."
+#define __AUTHOR "P Boon"
+#define __AUTHOREMAIL "unregistered@users.sourceforge.net"
+#define __AUTHORWEB "http://miranda-ng.org/p/KeepStatus/"
+#define __COPYRIGHT "(c) 2003-08 P. Boon, 2008-13 George Hazan"
// other stuff for Version resource
-#define __STRINGIFY_IMPL(x) #x
-#define __STRINGIFY(x) __STRINGIFY_IMPL(x)
+#define __STRINGIFY_IMPL(x) #x
+#define __STRINGIFY(x) __STRINGIFY_IMPL(x)
-#define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM
-#define __FILEVERSION_STRING_DOTS __MAJOR_VERSION.__MINOR_VERSION.__RELEASE_NUM.__BUILD_NUM
+#define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM
+#define __FILEVERSION_STRING_DOTS __MAJOR_VERSION.__MINOR_VERSION.__RELEASE_NUM.__BUILD_NUM
#ifdef _UNICODE
#ifdef __REV_NUM
-#define __VERSION_STRING __STRINGIFY(__FILEVERSION_STRING_DOTS rev. __REV_NUM Unicode)
+#define __VERSION_STRING __STRINGIFY(__FILEVERSION_STRING_DOTS rev. __REV_NUM Unicode)
#else
-#define __VERSION_STRING __STRINGIFY(__FILEVERSION_STRING_DOTS Unicode)
+#define __VERSION_STRING __STRINGIFY(__FILEVERSION_STRING_DOTS Unicode)
#endif
#else
#ifdef __REV_NUM
-#define __VERSION_STRING __STRINGIFY(__FILEVERSION_STRING_DOTS rev. __REV_NUM)
+#define __VERSION_STRING __STRINGIFY(__FILEVERSION_STRING_DOTS rev. __REV_NUM)
#else
-#define __VERSION_STRING __STRINGIFY(__FILEVERSION_STRING_DOTS)
+#define __VERSION_STRING __STRINGIFY(__FILEVERSION_STRING_DOTS)
#endif
#endif
-#define __PRODVERSION_STRING __PROD_MAJOR_VERSION,__PROD_MINOR_VERSION,__PROD_RELEASE_NUM,__PROD_BUILD_NUM
-#define __PRODVERSION_STRING_DOTS __PROD_MAJOR_VERSION.__PROD_MINOR_VERSION.__PROD_RELEASE_NUM.__PROD_BUILD_NUM
+#define __PRODVERSION_STRING __PROD_MAJOR_VERSION,__PROD_MINOR_VERSION,__PROD_RELEASE_NUM,__PROD_BUILD_NUM
+#define __PRODVERSION_STRING_DOTS __PROD_MAJOR_VERSION.__PROD_MINOR_VERSION.__PROD_RELEASE_NUM.__PROD_BUILD_NUM
#ifdef __PROD_REV_NUM
-#define __PROD_VERSION_STRING __STRINGIFY(__PRODVERSION_STRING_DOTS rev. __PROD_REV_NUM)
+#define __PROD_VERSION_STRING __STRINGIFY(__PRODVERSION_STRING_DOTS rev. __PROD_REV_NUM)
#else
-#define __PROD_VERSION_STRING __STRINGIFY(__PRODVERSION_STRING_DOTS+)
+#define __PROD_VERSION_STRING __STRINGIFY(__PRODVERSION_STRING_DOTS+)
#endif