From 5565e5b9839eea8a57e9c46f87e611dd546c8b46 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 7 Apr 2018 18:44:31 +0300 Subject: status caching moved from MenuItem to PROTOACCOUNT - this is very effective --- plugins/TipperYM/src/popwin.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'plugins/TipperYM') diff --git a/plugins/TipperYM/src/popwin.cpp b/plugins/TipperYM/src/popwin.cpp index efd68d09c7..f3fd175d27 100644 --- a/plugins/TipperYM/src/popwin.cpp +++ b/plugins/TipperYM/src/popwin.cpp @@ -1459,8 +1459,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa oldOrder = pa->iOrder; - WORD wStatus = CallProtoService(pa->szModuleName, PS_GETSTATUS, 0, 0); - if (opt.bHideOffline && wStatus == ID_STATUS_OFFLINE) + if (opt.bHideOffline && pa->iRealStatus == ID_STATUS_OFFLINE) continue; if (!pa->IsEnabled() || !IsTrayProto(pa->tszAccountName, (BOOL)wParam)) @@ -1483,7 +1482,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa if (pa->IsLocked()) mir_snwprintf(swzProto, TranslateT("%s (locked)"), pa->tszAccountName); - AddRow(pwd, swzProto, buff, nullptr, false, false, !bFirstItem, true, Skin_LoadProtoIcon(pa->szModuleName, wStatus)); + AddRow(pwd, swzProto, buff, nullptr, false, false, !bFirstItem, true, Skin_LoadProtoIcon(pa->szModuleName, pa->iRealStatus)); bFirstItem = false; if (dwItems & TRAYTIP_LOGON) { @@ -1503,14 +1502,14 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa } if (dwItems & TRAYTIP_STATUS) { - wchar_t *swzText = Clist_GetStatusModeDescription(wStatus, 0); + wchar_t *swzText = Clist_GetStatusModeDescription(pa->iRealStatus, 0); if (swzText) AddRow(pwd, TranslateT("Status:"), swzText, nullptr, false, false, false); } - if (wStatus >= ID_STATUS_ONLINE && wStatus <= ID_STATUS_OUTTOLUNCH) { + if (pa->iRealStatus >= ID_STATUS_ONLINE && pa->iRealStatus <= ID_STATUS_OUTTOLUNCH) { if (dwItems & TRAYTIP_STATUS_MSG) { - wchar_t *swzText = GetProtoStatusMessage(pa->szModuleName, wStatus); + wchar_t *swzText = GetProtoStatusMessage(pa->szModuleName, pa->iRealStatus); if (swzText) { StripBBCodesInPlace(swzText); AddRow(pwd, TranslateT("Status message:"), swzText, pa->szModuleName, true, true, false); -- cgit v1.2.3