summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM/src/globals.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-03-11 13:31:29 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-03-11 13:31:37 +0300
commitb9d32ad30a867c700166d8c8e618175b74b471d1 (patch)
treee430374a9d5236ace13a3b02841f086f9367b6c4 /plugins/TabSRMM/src/globals.cpp
parent660454c5c6c6728ced601ea9274ae4300814cbd2 (diff)
minor code optimization
Diffstat (limited to 'plugins/TabSRMM/src/globals.cpp')
-rw-r--r--plugins/TabSRMM/src/globals.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp
index 3634081ff7..ab212c69a6 100644
--- a/plugins/TabSRMM/src/globals.cpp
+++ b/plugins/TabSRMM/src/globals.cpp
@@ -402,21 +402,19 @@ int CGlobals::DBSettingChanged(WPARAM hContact, LPARAM lParam)
}
if (hwnd != nullptr) {
+ CTabBaseDlg *dat = c->getDat();
if (!strcmp(setting, "MirVer"))
PostMessage(hwnd, DM_CLIENTCHANGED, 0, 0);
- if (fChanged || fExtendedStatusChange)
- c->getDat()->UpdateTitle();
+ if (dat && fChanged || fExtendedStatusChange)
+ dat->UpdateTitle();
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
- CTabBaseDlg *dat = c->getDat();
- if (dat) {
- dat->m_nTypeSecs = 0;
- dat->m_bShowTyping = 0;
- dat->m_wszStatusBar[0] = 0;
- PostMessage(dat->GetHwnd(), DM_UPDATELASTMESSAGE, 0, 0);
- }
+ if (dat && c->getStatus() == ID_STATUS_OFFLINE) { // clear typing notification in the status bar when contact goes offline
+ dat->m_nTypeSecs = 0;
+ dat->m_bShowTyping = 0;
+ dat->m_wszStatusBar[0] = 0;
+ PostMessage(dat->GetHwnd(), DM_UPDATELASTMESSAGE, 0, 0);
}
PostMessage(PluginConfig.g_hwndHotkeyHandler, DM_LOGSTATUSCHANGE, MAKELONG(c->getStatus(), c->getOldStatus()), (LPARAM)c);
}