diff options
author | George Hazan <george.hazan@gmail.com> | 2014-10-07 16:00:32 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-10-07 16:00:32 +0000 |
commit | df0f5de95815eedd34834c9b4becb66c62b63033 (patch) | |
tree | 5b65bce56250fe7cbd0f15d035b1e2dcf98923ee /plugins/TabSRMM | |
parent | 640b434afb85687d2d84419550d4d62b04dc0ec5 (diff) |
fix for setting both meta's & sub's status text at a time
git-svn-id: http://svn.miranda-ng.org/main/trunk@10726 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TabSRMM')
-rw-r--r-- | plugins/TabSRMM/src/msgs.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index 1d2f9fc85e..d354ce1922 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -113,34 +113,34 @@ static INT_PTR GetWindowData(WPARAM wParam, LPARAM lParam) } // service function. Sets a status bar text for a contact - -static INT_PTR SetStatusText(WPARAM wParam, LPARAM lParam) +static void SetStatusTextWorker(TWindowData *dat, StatusTextData *st) { - TWindowData *dat; - - HWND hwnd = M.FindWindow(wParam); - if (hwnd != NULL) - dat = (TWindowData*)GetWindowLongPtr(hwnd, GWLP_USERDATA); - else { - SESSION_INFO *si = SM_FindSessionByHCONTACT(wParam); - if (si == NULL) - return 1; - - dat = si->dat; - } - // delete old custom data if (dat->sbCustom) { delete dat->sbCustom; dat->sbCustom = NULL; } - StatusTextData *st = (StatusTextData*)lParam; if (st != NULL && st->cbSize == sizeof(StatusTextData)) dat->sbCustom = new StatusTextData(*st); UpdateStatusBar(dat); +} + +static INT_PTR SetStatusText(WPARAM hContact, LPARAM lParam) +{ + SESSION_INFO *si = SM_FindSessionByHCONTACT(hContact); + if (si == NULL) { + HWND hwnd = M.FindWindow(hContact); + if (hwnd != NULL) + SetStatusTextWorker((TWindowData*)GetWindowLongPtr(hwnd, GWLP_USERDATA), (StatusTextData*)lParam); + if (hContact = db_mc_getMeta(hContact)) + if (hwnd = M.FindWindow(hContact)) + SetStatusTextWorker((TWindowData*)GetWindowLongPtr(hwnd, GWLP_USERDATA), (StatusTextData*)lParam); + } + else SetStatusTextWorker(si->dat, (StatusTextData*)lParam); + return 0; } |