From b9d32ad30a867c700166d8c8e618175b74b471d1 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 11 Mar 2017 13:31:29 +0300 Subject: minor code optimization --- plugins/TabSRMM/src/globals.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'plugins/TabSRMM/src') 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); } -- cgit v1.2.3