From 9d482ed81c2a6a3361a5a9b2d0efbfc4b6b815c5 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 15 Mar 2013 21:47:10 +0000 Subject: - POPUPDATAT_V2 replaced with POPUPDATAT in all possible cases; - fix: wrong popup initialization code; - code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@4057 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/TabSRMM/src/mim.cpp | 67 ++++++++++++++++++++------------------------- 1 file changed, 30 insertions(+), 37 deletions(-) (limited to 'plugins/TabSRMM/src/mim.cpp') diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp index f57c312a5a..0c9f5a33f9 100644 --- a/plugins/TabSRMM/src/mim.cpp +++ b/plugins/TabSRMM/src/mim.cpp @@ -502,14 +502,12 @@ void CMimAPI::InitAPI() int CMimAPI::TypingMessage(WPARAM wParam, LPARAM lParam) { - HWND hwnd = 0; - int issplit = 1, foundWin = 0, preTyping = 0; - struct TContainerData *pContainer = NULL; - BOOL fShowOnClist = TRUE; + HWND hwnd = 0; + int issplit = 1, foundWin = 0, preTyping = 0; + BOOL fShowOnClist = TRUE; if (wParam) { - - if ((hwnd = M->FindWindow((HANDLE) wParam)) && M->GetByte(SRMSGMOD, SRMSGSET_SHOWTYPING, SRMSGDEFSET_SHOWTYPING)) + if ((hwnd = M->FindWindow((HANDLE)wParam)) && M->GetByte(SRMSGMOD, SRMSGSET_SHOWTYPING, SRMSGDEFSET_SHOWTYPING)) preTyping = SendMessage(hwnd, DM_TYPING, 0, lParam); if (hwnd && IsWindowVisible(hwnd)) @@ -517,59 +515,54 @@ int CMimAPI::TypingMessage(WPARAM wParam, LPARAM lParam) else foundWin = 0; - + TContainerData *pContainer = NULL; if (hwnd) { SendMessage(hwnd, DM_QUERYCONTAINER, 0, (LPARAM)&pContainer); if (pContainer == NULL) return 0; // should never happen } - if (M->GetByte(SRMSGMOD, SRMSGSET_SHOWTYPINGCLIST, SRMSGDEFSET_SHOWTYPINGCLIST)) { + if ( M->GetByte(SRMSGMOD, SRMSGSET_SHOWTYPINGCLIST, SRMSGDEFSET_SHOWTYPINGCLIST)) { if (!hwnd && !M->GetByte(SRMSGMOD, SRMSGSET_SHOWTYPINGNOWINOPEN, 1)) fShowOnClist = FALSE; if (hwnd && !M->GetByte(SRMSGMOD, SRMSGSET_SHOWTYPINGWINOPEN, 1)) fShowOnClist = FALSE; } - else - fShowOnClist = FALSE; + else fShowOnClist = FALSE; - if ((!foundWin || !(pContainer->dwFlags&CNT_NOSOUND)) && preTyping != (lParam != 0)) { - if (lParam) - SkinPlaySound("TNStart"); - else - SkinPlaySound("TNStop"); - } + if ((!foundWin || !(pContainer->dwFlags&CNT_NOSOUND)) && preTyping != (lParam != 0)) + SkinPlaySound((lParam) ? "TNStart" : "TNStop"); if (M->GetByte(SRMSGMOD, "ShowTypingPopup", 0)) { - BOOL fShow = FALSE; - int iMode = M->GetByte("MTN_PopupMode", 0); + BOOL fShow = FALSE; + int iMode = M->GetByte("MTN_PopupMode", 0); switch(iMode) { - case 0: + case 0: + fShow = TRUE; + break; + case 1: + if (!foundWin || !(pContainer && pContainer->hwndActive == hwnd && GetForegroundWindow() == pContainer->hwnd)) fShow = TRUE; - break; - case 1: - if (!foundWin || !(pContainer && pContainer->hwndActive == hwnd && GetForegroundWindow() == pContainer->hwnd)) - fShow = TRUE; - break; - case 2: - if (hwnd == 0) - fShow = TRUE; - else { - if (PluginConfig.m_HideOnClose) { - struct TContainerData *pContainer = 0; - SendMessage(hwnd, DM_QUERYCONTAINER, 0, (LPARAM)&pContainer); - if (pContainer && pContainer->fHidden) - fShow = TRUE; - } + break; + case 2: + if (hwnd == 0) + fShow = TRUE; + else { + if (PluginConfig.m_HideOnClose) { + struct TContainerData *pContainer = 0; + SendMessage(hwnd, DM_QUERYCONTAINER, 0, (LPARAM)&pContainer); + if (pContainer && pContainer->fHidden) + fShow = TRUE; } - break; + } + break; } if (fShow) - TN_TypingMessage(wParam, lParam); + TN_TypingMessage((HANDLE)wParam, lParam); } - if ((int) lParam) { + if (lParam) { TCHAR szTip[256]; _sntprintf(szTip, SIZEOF(szTip), TranslateT("%s is typing a message."), (TCHAR *) CallService(MS_CLIST_GETCONTACTDISPLAYNAME, wParam, GCDNF_TCHAR)); -- cgit v1.2.3