From ef1a349d88912a89a8dd20ca1dcb342b6dc9c2ff Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 27 May 2019 18:45:43 +0300 Subject: fixes #1963 (Remove Free for Chat, On the Phone and Out to Lunch statuses completely) --- src/core/stdautoaway/src/autoaway.cpp | 4 ++-- src/core/stdautoaway/src/options.cpp | 2 +- src/core/stdaway/src/sendmsg.cpp | 8 +------- src/core/stdclist/src/clcopts.cpp | 8 +------- src/core/stdclist/src/contact.cpp | 5 +---- src/core/stdmsg/src/msgoptions.cpp | 3 --- src/core/stdmsg/src/msgs.cpp | 3 --- src/core/stdpopup/src/message_pump.cpp | 2 +- src/core/stduseronline/src/useronline.cpp | 2 +- src/mir_app/res/resource.rc | 5 +---- src/mir_app/src/clcidents.cpp | 3 --- src/mir_app/src/clcutils.cpp | 3 --- src/mir_app/src/clistmod.cpp | 9 --------- src/mir_app/src/menu_clist.cpp | 6 +----- src/mir_app/src/meta_services.cpp | 6 +++--- src/mir_app/src/meta_utils.cpp | 13 +++++-------- src/mir_app/src/skinicons.cpp | 3 --- 17 files changed, 18 insertions(+), 67 deletions(-) (limited to 'src') diff --git a/src/core/stdautoaway/src/autoaway.cpp b/src/core/stdautoaway/src/autoaway.cpp index 40f9c2779d..6511746e2a 100644 --- a/src/core/stdautoaway/src/autoaway.cpp +++ b/src/core/stdautoaway/src/autoaway.cpp @@ -75,7 +75,7 @@ static int AutoAwayEvent(WPARAM, LPARAM lParam) status = ID_STATUS_AWAY; if (lParam & IDF_ISIDLE) { - if (pa->iRealStatus != ID_STATUS_ONLINE && pa->iRealStatus != ID_STATUS_FREECHAT) { + if (pa->iRealStatus != ID_STATUS_ONLINE) { Netlib_Logf(0, "%s: '%s' isn't online (%d), skipping", MODULENAME, pa->szModuleName, pa->iRealStatus); continue; } @@ -87,7 +87,7 @@ static int AutoAwayEvent(WPARAM, LPARAM lParam) } else { int oldstatus = g_plugin.getWord(pa->szModuleName, 0); - if (oldstatus != ID_STATUS_ONLINE && oldstatus != ID_STATUS_FREECHAT) { + if (oldstatus != ID_STATUS_ONLINE) { Netlib_Logf(0, "%s: '%s' wasn't online (%d), skipping", MODULENAME, pa->szModuleName, oldstatus); continue; } diff --git a/src/core/stdautoaway/src/options.cpp b/src/core/stdautoaway/src/options.cpp index ad04fdb3a3..f8c8db394f 100644 --- a/src/core/stdautoaway/src/options.cpp +++ b/src/core/stdautoaway/src/options.cpp @@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h" -static const WORD aa_Status[] = { ID_STATUS_AWAY, ID_STATUS_NA, ID_STATUS_OCCUPIED, ID_STATUS_DND, ID_STATUS_ONTHEPHONE, ID_STATUS_OUTTOLUNCH }; +static const WORD aa_Status[] = { ID_STATUS_AWAY, ID_STATUS_NA, ID_STATUS_OCCUPIED, ID_STATUS_DND }; int IdleGetStatusIndex(WORD status) { diff --git a/src/core/stdaway/src/sendmsg.cpp b/src/core/stdaway/src/sendmsg.cpp index 00a9012044..bd4b8440ee 100644 --- a/src/core/stdaway/src/sendmsg.cpp +++ b/src/core/stdaway/src/sendmsg.cpp @@ -34,12 +34,9 @@ static const wchar_t* GetDefaultMessage(int status) case ID_STATUS_NA: return TranslateT("Give it up, I'm not in!"); case ID_STATUS_OCCUPIED: return TranslateT("Not right now."); case ID_STATUS_DND: return TranslateT("Give a guy some peace, would ya?"); - case ID_STATUS_FREECHAT: return TranslateT("I'm a chatbot!"); case ID_STATUS_ONLINE: return TranslateT("Yep, I'm here."); case ID_STATUS_OFFLINE: return TranslateT("Nope, not here."); case ID_STATUS_INVISIBLE: return TranslateT("I'm hiding from the mafia."); - case ID_STATUS_ONTHEPHONE: return TranslateT("That'll be the phone."); - case ID_STATUS_OUTTOLUNCH: return TranslateT("Mmm... food."); case ID_STATUS_IDLE: return TranslateT("idleeeeeeee"); } return nullptr; @@ -55,12 +52,9 @@ static const char* StatusModeToDbSetting(int status, const char *suffix) case ID_STATUS_NA: prefix = "Na"; break; case ID_STATUS_DND: prefix = "Dnd"; break; case ID_STATUS_OCCUPIED: prefix = "Occupied"; break; - case ID_STATUS_FREECHAT: prefix = "FreeChat"; break; case ID_STATUS_ONLINE: prefix = "On"; break; case ID_STATUS_OFFLINE: prefix = "Off"; break; case ID_STATUS_INVISIBLE: prefix = "Inv"; break; - case ID_STATUS_ONTHEPHONE: prefix = "Otp"; break; - case ID_STATUS_OUTTOLUNCH: prefix = "Otl"; break; case ID_STATUS_IDLE: prefix = "Idl"; break; default: return nullptr; } @@ -340,7 +334,7 @@ static int StatusModeChange(WPARAM wParam, LPARAM lParam) static const int statusModes[] = { ID_STATUS_OFFLINE, ID_STATUS_ONLINE, ID_STATUS_AWAY, ID_STATUS_NA, ID_STATUS_OCCUPIED, ID_STATUS_DND, - ID_STATUS_FREECHAT, ID_STATUS_INVISIBLE, ID_STATUS_OUTTOLUNCH, ID_STATUS_ONTHEPHONE, ID_STATUS_IDLE + ID_STATUS_INVISIBLE, ID_STATUS_IDLE }; struct AwayMsgInfo diff --git a/src/core/stdclist/src/clcopts.cpp b/src/core/stdclist/src/clcopts.cpp index 6233f348a7..c9070e91f3 100644 --- a/src/core/stdclist/src/clcopts.cpp +++ b/src/core/stdclist/src/clcopts.cpp @@ -66,10 +66,7 @@ static const struct CheckBoxValues_t greyoutValues[] = { PF2_LONGAWAY, LPGENW("Not available") }, { PF2_LIGHTDND, LPGENW("Occupied") }, { PF2_HEAVYDND, LPGENW("Do not disturb")}, - { PF2_FREECHAT, LPGENW("Free for chat") }, - { PF2_INVISIBLE, LPGENW("Invisible") }, - { PF2_OUTTOLUNCH, LPGENW("Out to lunch") }, - { PF2_ONTHEPHONE, LPGENW("On the phone") } + { PF2_INVISIBLE, LPGENW("Invisible") } }; static const struct CheckBoxValues_t offlineValues[] = @@ -80,10 +77,7 @@ static const struct CheckBoxValues_t offlineValues[] = { PF2_LONGAWAY, LPGENW("Not available") }, { PF2_LIGHTDND, LPGENW("Occupied") }, { PF2_HEAVYDND, LPGENW("Do not disturb")}, - { PF2_FREECHAT, LPGENW("Free for chat") }, { PF2_INVISIBLE, LPGENW("Invisible") }, - { PF2_OUTTOLUNCH, LPGENW("Out to lunch") }, - { PF2_ONTHEPHONE, LPGENW("On the phone") } }; static void FillCheckBoxTree(HWND hwndTree, const struct CheckBoxValues_t *values, int nValues, DWORD style) diff --git a/src/core/stdclist/src/contact.cpp b/src/core/stdclist/src/contact.cpp index 7c77f5f465..3a561482d0 100644 --- a/src/core/stdclist/src/contact.cpp +++ b/src/core/stdclist/src/contact.cpp @@ -38,10 +38,7 @@ static statusModeOrder[] = { ID_STATUS_DND, 110 }, { ID_STATUS_NA, 450 }, { ID_STATUS_OCCUPIED, 100 }, - { ID_STATUS_FREECHAT, 0 }, - { ID_STATUS_INVISIBLE, 20 }, - { ID_STATUS_ONTHEPHONE, 150 }, - { ID_STATUS_OUTTOLUNCH, 425 } + { ID_STATUS_INVISIBLE, 20 } }; int GetStatusModeOrdering(int statusMode) diff --git a/src/core/stdmsg/src/msgoptions.cpp b/src/core/stdmsg/src/msgoptions.cpp index c45ced4938..e4ce31045b 100644 --- a/src/core/stdmsg/src/msgoptions.cpp +++ b/src/core/stdmsg/src/msgoptions.cpp @@ -139,10 +139,7 @@ statusValues[] = { PF2_LONGAWAY, LPGENW("Not available") }, { PF2_LIGHTDND, LPGENW("Occupied") }, { PF2_HEAVYDND, LPGENW("Do not disturb") }, - { PF2_FREECHAT, LPGENW("Free for chat") }, { PF2_INVISIBLE, LPGENW("Invisible") }, - { PF2_OUTTOLUNCH, LPGENW("Out to lunch") }, - { PF2_ONTHEPHONE, LPGENW("On the phone") } }; class COptionMainDlg : public CDlgBase diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp index 84fad84fba..e78c57968a 100644 --- a/src/core/stdmsg/src/msgs.cpp +++ b/src/core/stdmsg/src/msgs.cpp @@ -108,10 +108,7 @@ static int SRMMStatusToPf2(int status) case ID_STATUS_DND: return PF2_HEAVYDND; case ID_STATUS_NA: return PF2_LONGAWAY; case ID_STATUS_OCCUPIED: return PF2_LIGHTDND; - case ID_STATUS_FREECHAT: return PF2_FREECHAT; case ID_STATUS_INVISIBLE: return PF2_INVISIBLE; - case ID_STATUS_ONTHEPHONE: return PF2_ONTHEPHONE; - case ID_STATUS_OUTTOLUNCH: return PF2_OUTTOLUNCH; case ID_STATUS_OFFLINE: return MODEF_OFFLINE; } return 0; diff --git a/src/core/stdpopup/src/message_pump.cpp b/src/core/stdpopup/src/message_pump.cpp index 977f139219..8b609eafc9 100644 --- a/src/core/stdpopup/src/message_pump.cpp +++ b/src/core/stdpopup/src/message_pump.cpp @@ -23,7 +23,7 @@ unsigned __stdcall MessagePumpThread(void* param) { bool enabled = true; int status = CallService(MS_CLIST_GETSTATUSMODE, 0, 0); - if (status >= ID_STATUS_OFFLINE && status <= ID_STATUS_OUTTOLUNCH && options.disable_status[status - ID_STATUS_OFFLINE]) + if (status >= ID_STATUS_OFFLINE && status <= ID_STATUS_MAX && options.disable_status[status - ID_STATUS_OFFLINE]) enabled = false; if ((options.disable_full_screen && IsFullScreen()) || IsWorkstationLocked()) enabled = false; diff --git a/src/core/stduseronline/src/useronline.cpp b/src/core/stduseronline/src/useronline.cpp index 1c3a6d3640..e1de0b8f03 100644 --- a/src/core/stduseronline/src/useronline.cpp +++ b/src/core/stduseronline/src/useronline.cpp @@ -46,7 +46,7 @@ static int UserOnlineSettingChanged(WPARAM hContact, LPARAM lParam) } } - if ((newStatus == ID_STATUS_ONLINE || newStatus == ID_STATUS_FREECHAT) && oldStatus != ID_STATUS_ONLINE && oldStatus != ID_STATUS_FREECHAT) { + if (newStatus == ID_STATUS_ONLINE && oldStatus != ID_STATUS_ONLINE) { DWORD ticked = g_plugin.getDword(cws->szModule, GetTickCount()); // only play the sound (or show event) if this event happens at least 10 secs after the proto went from offline if (GetTickCount() - ticked > (1000 * 10)) { diff --git a/src/mir_app/res/resource.rc b/src/mir_app/res/resource.rc index 5b38ef109c..a6931e5905 100644 --- a/src/mir_app/res/resource.rc +++ b/src/mir_app/res/resource.rc @@ -1310,10 +1310,7 @@ BEGIN MENUITEM "&Not available\tCtrl+3", ID_STATUS_NA MENUITEM "Occ&upied\tCtrl+4", ID_STATUS_OCCUPIED MENUITEM "&Do not disturb\tCtrl+5", ID_STATUS_DND - MENUITEM "&Free for chat\tCtrl+6", ID_STATUS_FREECHAT - MENUITEM "&Invisible\tCtrl+7", ID_STATUS_INVISIBLE - MENUITEM "On the &phone\tCtrl+8", ID_STATUS_ONTHEPHONE - MENUITEM "Out to &lunch\tCtrl+9", ID_STATUS_OUTTOLUNCH + MENUITEM "&Invisible\tCtrl+6", ID_STATUS_INVISIBLE END END diff --git a/src/mir_app/src/clcidents.cpp b/src/mir_app/src/clcidents.cpp index fd1bcbd3b2..35a2552c0d 100644 --- a/src/mir_app/src/clcidents.cpp +++ b/src/mir_app/src/clcidents.cpp @@ -244,13 +244,10 @@ MIR_APP_DLL(int) Clist_GetGeneralizedStatus(char **szProto) int iStatusWeight; switch (pa->iRealStatus) { - case ID_STATUS_FREECHAT: iStatusWeight = 110; break; case ID_STATUS_ONLINE: iStatusWeight = 100; break; case ID_STATUS_OCCUPIED: iStatusWeight = 60; break; - case ID_STATUS_ONTHEPHONE: iStatusWeight = 50; break; case ID_STATUS_DND: iStatusWeight = 40; break; case ID_STATUS_AWAY: iStatusWeight = 30; break; - case ID_STATUS_OUTTOLUNCH: iStatusWeight = 20; break; case ID_STATUS_NA: iStatusWeight = 10; break; case ID_STATUS_INVISIBLE: iStatusWeight = 5; break; default: diff --git a/src/mir_app/src/clcutils.cpp b/src/mir_app/src/clcutils.cpp index 58fb0184f1..980a424d57 100644 --- a/src/mir_app/src/clcutils.cpp +++ b/src/mir_app/src/clcutils.cpp @@ -624,10 +624,7 @@ MIR_APP_DLL(int) Clist_ClcStatusToPf2(int status) case ID_STATUS_DND: return PF2_HEAVYDND; case ID_STATUS_NA: return PF2_LONGAWAY; case ID_STATUS_OCCUPIED: return PF2_LIGHTDND; - case ID_STATUS_FREECHAT: return PF2_FREECHAT; case ID_STATUS_INVISIBLE: return PF2_INVISIBLE; - case ID_STATUS_ONTHEPHONE: return PF2_ONTHEPHONE; - case ID_STATUS_OUTTOLUNCH: return PF2_OUTTOLUNCH; case ID_STATUS_OFFLINE: return MODEF_OFFLINE; } return 0; diff --git a/src/mir_app/src/clistmod.cpp b/src/mir_app/src/clistmod.cpp index ed4c445e2a..70a5fde409 100644 --- a/src/mir_app/src/clistmod.cpp +++ b/src/mir_app/src/clistmod.cpp @@ -74,18 +74,9 @@ MIR_APP_DLL(wchar_t*) Clist_GetStatusModeDescription(int mode, int flags) case ID_STATUS_OCCUPIED: descr = LPGENW("Occupied"); break; - case ID_STATUS_FREECHAT: - descr = LPGENW("Free for chat"); - break; case ID_STATUS_INVISIBLE: descr = LPGENW("Invisible"); break; - case ID_STATUS_OUTTOLUNCH: - descr = LPGENW("Out to lunch"); - break; - case ID_STATUS_ONTHEPHONE: - descr = LPGENW("On the phone"); - break; case ID_STATUS_IDLE: descr = LPGENW("Idle"); break; diff --git a/src/mir_app/src/menu_clist.cpp b/src/mir_app/src/menu_clist.cpp index f47364a1a0..e266b712d5 100644 --- a/src/mir_app/src/menu_clist.cpp +++ b/src/mir_app/src/menu_clist.cpp @@ -63,10 +63,7 @@ MStatus g_statuses[MAX_STATUS_COUNT] = { ID_STATUS_NA, SKINICON_STATUS_NA, PF2_LONGAWAY }, { ID_STATUS_OCCUPIED, SKINICON_STATUS_OCCUPIED, PF2_LIGHTDND }, { ID_STATUS_DND, SKINICON_STATUS_DND, PF2_HEAVYDND }, - { ID_STATUS_FREECHAT, SKINICON_STATUS_FREE4CHAT, PF2_FREECHAT }, { ID_STATUS_INVISIBLE, SKINICON_STATUS_INVISIBLE, PF2_INVISIBLE }, - { ID_STATUS_ONTHEPHONE, SKINICON_STATUS_ONTHEPHONE, PF2_ONTHEPHONE }, - { ID_STATUS_OUTTOLUNCH, SKINICON_STATUS_OUTTOLUNCH, PF2_OUTTOLUNCH }, }; static int statustopos(int status) @@ -588,7 +585,7 @@ static INT_PTR FreeOwnerDataStatusMenu(WPARAM, LPARAM lParam) MIR_APP_DLL(BOOL) Clist_MenuProcessCommand(int menu_id, int flags, MCONTACT hContact) { if (flags & MPCF_MAINMENU) { - if (menu_id >= ID_STATUS_OFFLINE && menu_id <= ID_STATUS_OUTTOLUNCH) { + if (menu_id >= ID_STATUS_OFFLINE && menu_id <= ID_STATUS_MAX) { int pos = statustopos(menu_id); if (pos != -1) return Menu_ProcessCommand(g_statuses[pos].hStatusMenu, hContact); @@ -783,7 +780,6 @@ void RebuildMenuOrder(void) smep->szProto = mir_strdup(pa->szModuleName); pa->protoindex = i; - pa->protostatus[j] = g_statuses[j].iStatus; pa->menuhandle[j] = Menu_AddItem(hStatusMenuObject, &mi, smep); mir_snprintf(buf, "ProtocolIcon_%s_%s", pa->szModuleName, mi.name.a); diff --git a/src/mir_app/src/meta_services.cpp b/src/mir_app/src/meta_services.cpp index 49547f73f1..7b89a95b1a 100644 --- a/src/mir_app/src/meta_services.cpp +++ b/src/mir_app/src/meta_services.cpp @@ -56,16 +56,16 @@ INT_PTR Meta_GetCaps(WPARAM wParam, LPARAM) return PF1_IM | PF1_CHAT | PF1_FILESEND | PF1_MODEMSGRECV | PF1_NUMERICUSERID; case PFLAGNUM_2: - return PF2_ONLINE | PF2_INVISIBLE | PF2_SHORTAWAY | PF2_LONGAWAY | PF2_LIGHTDND | PF2_HEAVYDND | PF2_FREECHAT | PF2_OUTTOLUNCH | PF2_ONTHEPHONE; + return PF2_ONLINE | PF2_INVISIBLE | PF2_SHORTAWAY | PF2_LONGAWAY | PF2_LIGHTDND | PF2_HEAVYDND; case PFLAGNUM_3: - return PF2_ONLINE | PF2_INVISIBLE | PF2_SHORTAWAY | PF2_LONGAWAY | PF2_LIGHTDND | PF2_HEAVYDND | PF2_FREECHAT | PF2_OUTTOLUNCH | PF2_ONTHEPHONE; + return PF2_ONLINE | PF2_INVISIBLE | PF2_SHORTAWAY | PF2_LONGAWAY | PF2_LIGHTDND | PF2_HEAVYDND; case PFLAGNUM_4: return PF4_SUPPORTTYPING | PF4_AVATARS; case PFLAGNUM_5: - return PF2_INVISIBLE | PF2_SHORTAWAY | PF2_LONGAWAY | PF2_LIGHTDND | PF2_HEAVYDND | PF2_FREECHAT | PF2_OUTTOLUNCH | PF2_ONTHEPHONE; + return PF2_INVISIBLE | PF2_SHORTAWAY | PF2_LONGAWAY | PF2_LIGHTDND | PF2_HEAVYDND; case PFLAG_MAXLENOFMESSAGE: return 2000; diff --git a/src/mir_app/src/meta_utils.cpp b/src/mir_app/src/meta_utils.cpp index 8b2d5af91e..2b7ccab6a2 100644 --- a/src/mir_app/src/meta_utils.cpp +++ b/src/mir_app/src/meta_utils.cpp @@ -209,14 +209,11 @@ MCONTACT Meta_GetMostOnline(DBCachedContact *cc) static int GetStatusPriority(int status) { switch (status) { - case ID_STATUS_OFFLINE: return 8; - case ID_STATUS_AWAY: return 4; - case ID_STATUS_DND: return 7; - case ID_STATUS_NA: return 6; - case ID_STATUS_OCCUPIED: return 5; - case ID_STATUS_FREECHAT: return 1; - case ID_STATUS_ONTHEPHONE: return 2; - case ID_STATUS_OUTTOLUNCH: return 3; + case ID_STATUS_AWAY: return 1; + case ID_STATUS_OCCUPIED: return 2; + case ID_STATUS_NA: return 3; + case ID_STATUS_DND: return 4; + case ID_STATUS_OFFLINE: return 5; } return 0; diff --git a/src/mir_app/src/skinicons.cpp b/src/mir_app/src/skinicons.cpp index 5c5c4b5a2b..ce1d786010 100644 --- a/src/mir_app/src/skinicons.cpp +++ b/src/mir_app/src/skinicons.cpp @@ -108,10 +108,7 @@ static struct StandardIconDescription statusIcons[] = { ID_STATUS_NA, LPGEN("Not available"), -IDI_NA, PF2_LONGAWAY }, { ID_STATUS_OCCUPIED, LPGEN("Occupied"), -IDI_OCCUPIED, PF2_LIGHTDND }, { ID_STATUS_DND, LPGEN("Do not disturb"), -IDI_DND, PF2_HEAVYDND }, - { ID_STATUS_FREECHAT, LPGEN("Free for chat"), -IDI_FREE4CHAT, PF2_FREECHAT }, { ID_STATUS_INVISIBLE, LPGEN("Invisible"), -IDI_INVISIBLE, PF2_INVISIBLE }, - { ID_STATUS_ONTHEPHONE, LPGEN("On the phone"), -IDI_ONTHEPHONE, PF2_ONTHEPHONE }, - { ID_STATUS_OUTTOLUNCH, LPGEN("Out to lunch"), -IDI_OUTTOLUNCH, PF2_OUTTOLUNCH } }; const char mainIconsFmt[] = "core_main_"; -- cgit v1.2.3