diff options
author | George Hazan <george.hazan@gmail.com> | 2016-08-08 11:12:32 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-08-08 11:12:32 +0000 |
commit | 2cdd9ae1c6bbd4c19dcf3393db1943c1dff39604 (patch) | |
tree | 2423705f3ebb84915ca84d3c34d375df1a016bd2 /plugins/TabSRMM/src/globals.cpp | |
parent | 77d2c4bc51547dcf8812375812961c9fbb87e666 (diff) |
more cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@17170 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TabSRMM/src/globals.cpp')
-rw-r--r-- | plugins/TabSRMM/src/globals.cpp | 48 |
1 files changed, 23 insertions, 25 deletions
diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp index 79cbc76fb5..3cdb3315ac 100644 --- a/plugins/TabSRMM/src/globals.cpp +++ b/plugins/TabSRMM/src/globals.cpp @@ -380,16 +380,15 @@ int CGlobals::DBSettingChanged(WPARAM hContact, LPARAM lParam) return 0;
if (!strcmp(cws->szModule, META_PROTO))
- if (hContact != 0 && !strcmp(setting, "Nick")) // filter out this setting to avoid infinite loops while trying to obtain the most online contact
+ if (!strcmp(setting, "Nick")) // filter out this setting to avoid infinite loops while trying to obtain the most online contact
return 0;
HWND hwnd = M.FindWindow(hContact);
- bool fChanged = false, fNickChanged = false, fExtendedStatusChange = false;
- if (!strcmp(cws->szSetting, "Status")) {
- c->updateStatus();
- fChanged = true;
- }
- fNickChanged = c->updateNick();
+ bool fChanged = false, fExtendedStatusChange = false;
+ if (!strcmp(cws->szSetting, "Status"))
+ fChanged = c->updateStatus(cws->value.wVal);
+
+ fChanged |= c->updateNick();
if (strlen(setting) > 6 && strlen(setting) < 9 && !strncmp(setting, "Status", 6)) {
fChanged = true;
@@ -406,26 +405,25 @@ int CGlobals::DBSettingChanged(WPARAM hContact, LPARAM lParam) PostMessage(hwnd, DM_UPDATEUIN, 0, 0);
}
- if (hwnd == NULL)
- return 0;
-
- if (!strcmp(setting, "MirVer"))
- PostMessage(hwnd, DM_CLIENTCHANGED, 0, 0);
- if (fChanged || fNickChanged || fExtendedStatusChange)
- PostMessage(hwnd, DM_UPDATETITLE, 0, 1);
- if (fExtendedStatusChange)
- PostMessage(hwnd, DM_UPDATESTATUSMSG, 0, 0);
- if (fChanged) {
- if (c->getStatus() == ID_STATUS_OFFLINE) { // clear typing notification in the status bar when contact goes offline
- TWindowData *dat = c->getDat();
- if (dat) {
- dat->nTypeSecs = 0;
- dat->bShowTyping = 0;
- dat->szStatusBar[0] = 0;
- PostMessage(c->getHwnd(), DM_UPDATELASTMESSAGE, 0, 0);
+ if (hwnd != NULL) {
+ if (!strcmp(setting, "MirVer"))
+ PostMessage(hwnd, DM_CLIENTCHANGED, 0, 0);
+ if (fChanged || fExtendedStatusChange)
+ PostMessage(hwnd, DM_UPDATETITLE, 0, 1);
+ if (fExtendedStatusChange)
+ PostMessage(hwnd, DM_UPDATESTATUSMSG, 0, 0);
+ if (fChanged) {
+ if (c->getStatus() == ID_STATUS_OFFLINE) { // clear typing notification in the status bar when contact goes offline
+ TWindowData *dat = c->getDat();
+ if (dat) {
+ dat->nTypeSecs = 0;
+ dat->bShowTyping = 0;
+ dat->szStatusBar[0] = 0;
+ PostMessage(c->getHwnd(), DM_UPDATELASTMESSAGE, 0, 0);
+ }
}
+ PostMessage(PluginConfig.g_hwndHotkeyHandler, DM_LOGSTATUSCHANGE, MAKELONG(c->getStatus(), c->getOldStatus()), (LPARAM)c);
}
- PostMessage(PluginConfig.g_hwndHotkeyHandler, DM_LOGSTATUSCHANGE, MAKELONG(c->getStatus(), c->getOldStatus()), (LPARAM)c);
}
return 0;
|