summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2014-04-23 14:43:58 +0000
committerRobert Pösel <robyer@seznam.cz>2014-04-23 14:43:58 +0000
commitb0e8308aec2c842375615fff8377e9b59a649061 (patch)
tree421506968e6d5a4537d4e095979e6c4344601002 /plugins
parent398b795a10e915656b8eade2439ab4ac33d4a928 (diff)
TabSRMM: Add typing support for GCW_PRIVMESS sessions
git-svn-id: http://svn.miranda-ng.org/main/trunk@9059 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r--plugins/TabSRMM/src/chat/window.cpp55
1 files changed, 55 insertions, 0 deletions
diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp
index ad5e669a09..f0184f719e 100644
--- a/plugins/TabSRMM/src/chat/window.cpp
+++ b/plugins/TabSRMM/src/chat/window.cpp
@@ -1877,6 +1877,12 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
dat->fInsertMode = FALSE;
+ // Typing support for GCW_PRIVMESS sessions
+ if (si->iType == GCW_PRIVMESS) {
+ dat->nTypeMode = PROTOTYPE_SELFTYPING_OFF;
+ SetTimer(hwndDlg, TIMERID_TYPE, 1000, NULL);
+ }
+
dat->codePage = M.GetDword(dat->hContact, "ANSIcodepage", CP_ACP);
dat->Panel->getVisibility();
dat->Panel->Configure();
@@ -2218,6 +2224,20 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_SETREADONLY, FALSE, 0);
SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, WM_SETTEXT, 0, (LPARAM)_T(""));
return TRUE;
+
+ case DM_TYPING: {
+ // Typing support for GCW_PRIVMESS sessions
+ if (si->iType == GCW_PRIVMESS) {
+ int preTyping = dat->nTypeSecs != 0;
+ dat->nTypeSecs = (int) lParam > 0 ? (int) lParam : 0;
+
+ if(dat->nTypeSecs)
+ dat->showTyping = 0;
+
+ SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, preTyping);
+ }
+ return TRUE;
+ }
case WM_CTLCOLORLISTBOX:
SetBkColor((HDC) wParam, g_Settings.crUserListBGColor);
@@ -2524,6 +2544,13 @@ LABEL_SHOWWINDOW:
if (wParam == TIMERID_FLASHWND)
if (dat->mayFlashTab)
FlashTab(dat, hwndTab, dat->iTabID, &dat->bTabFlash, TRUE, dat->hTabIcon);
+
+ // Typing support for GCW_PRIVMESS sessions
+ if (si->iType == GCW_PRIVMESS) {
+ if (wParam == TIMERID_TYPE)
+ DM_Typing(dat);
+ }
+
break;
case WM_ACTIVATE:
@@ -2975,6 +3002,13 @@ LABEL_SHOWWINDOW:
Utils::enableDlgControl(hwndDlg, IDOK, FALSE);
+ // Typing support for GCW_PRIVMESS sessions
+ if (si->iType == GCW_PRIVMESS) {
+ if (dat->nTypeMode == PROTOTYPE_SELFTYPING_ON) {
+ DM_NotifyTyping(dat, PROTOTYPE_SELFTYPING_OFF);
+ }
+ }
+
bool fSound = true;
if (ptszText[0] == '/' || si->iType == GCW_SERVER)
fSound = false;
@@ -3012,6 +3046,21 @@ LABEL_SHOWWINDOW:
dat->pContainer->dwLastActivity = dat->dwLastActivity;
SendDlgItemMessage(hwndDlg, IDOK, BUTTONSETASNORMAL, GetRichTextLength(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE)) != 0, 0);
Utils::enableDlgControl(hwndDlg, IDOK, GetRichTextLength(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE)) != 0);
+
+ // Typing support for GCW_PRIVMESS sessions
+ if (si->iType == GCW_PRIVMESS) {
+ if (!(GetKeyState(VK_CONTROL) & 0x8000)) {
+ dat->nLastTyping = GetTickCount();
+ if (GetWindowTextLength(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE))) {
+ if (dat->nTypeMode == PROTOTYPE_SELFTYPING_OFF) {
+ if (!(dat->dwFlags & MWF_INITMODE))
+ DM_NotifyTyping(dat, PROTOTYPE_SELFTYPING_ON);
+ }
+ }
+ else if (dat->nTypeMode == PROTOTYPE_SELFTYPING_ON)
+ DM_NotifyTyping(dat, PROTOTYPE_SELFTYPING_OFF);
+ }
+ }
}
break;
@@ -3548,6 +3597,12 @@ LABEL_SHOWWINDOW:
if (dat->pContainer->settings->fPrivate && !IsAutoSplitEnabled(dat))
db_set_w(NULL, CHAT_MODULE, "splitY", (WORD)g_Settings.iSplitterY);
+ // Typing support for GCW_PRIVMESS sessions
+ if (si->iType == GCW_PRIVMESS) {
+ if (dat->nTypeMode == PROTOTYPE_SELFTYPING_ON)
+ DM_NotifyTyping(dat, PROTOTYPE_SELFTYPING_OFF);
+ }
+
DM_FreeTheme(dat);
UpdateTrayMenuState(dat, FALSE); // remove me from the tray menu (if still there)