From 9536e0bb47b12ea2ae01ab070dd9f6aa5bb360c2 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 29 Dec 2023 17:03:21 +0300 Subject: =?UTF-8?q?fixes=20#4085=20(=D0=A3=D0=B4=D0=B0=D0=BB=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20=D0=BD=D0=B0=D1=81=D1=82=D1=80=D0=BE=D0=B9=D0=BA=D0=B8?= =?UTF-8?q?=20=D0=BD=D0=B5=D0=B2=D0=B8=D0=B4=D0=B8=D0=BC=D0=BE=D1=81=D1=82?= =?UTF-8?q?=D0=B8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/m_protoint.h | 1 - include/m_protosvc.h | 16 -- libs/win32/mir_app.lib | Bin 277558 -> 277222 bytes libs/win64/mir_app.lib | Bin 276852 -> 276512 bytes plugins/AVS/src/poll.cpp | 3 +- plugins/Clist_modern/src/modern_awaymsg.cpp | 4 +- plugins/Clist_modern/src/modern_clc.h | 2 - plugins/Clist_modern/src/modern_clcitems.cpp | 18 -- plugins/Clist_modern/src/modern_clist.h | 1 - plugins/Clist_modern/src/modern_clistsettings.cpp | 2 - plugins/Clist_modern/src/resource.h | 1 - plugins/FloatingContacts/src/main.cpp | 2 - plugins/FloatingContacts/src/thumbs.cpp | 28 +-- plugins/MenuItemEx/res/resource.rc | 1 - plugins/MenuItemEx/src/main.cpp | 66 +---- plugins/MenuItemEx/src/options.cpp | 10 +- plugins/MenuItemEx/src/resource.h | 1 - plugins/MenuItemEx/src/stdafx.h | 1 - plugins/MirandaG15/src/CAppletManager.cpp | 5 - plugins/NewAwaySysMod/res/NewAwaySys.rc | 2 - plugins/NewAwaySysMod/src/AwayOpt.cpp | 2 - plugins/NewAwaySysMod/src/MsgEventAdded.cpp | 5 - plugins/NewAwaySysMod/src/resource.h | 1 - plugins/Scriver/src/msgutils.cpp | 7 - plugins/SecureIM/src/crypt_check.cpp | 12 - plugins/ShellExt/src/shlcom.cpp | 4 - plugins/StopSpamMod/src/stopspam.cpp | 7 +- plugins/TabSRMM/src/generic_msghandlers.cpp | 9 - plugins/TabSRMM/src/msgdlgother.cpp | 8 +- plugins/TipperYM/res/resource.rc | 4 +- plugins/TipperYM/src/options.cpp | 10 - plugins/TipperYM/src/options.h | 1 - plugins/TipperYM/src/resource.h | 1 - plugins/TipperYM/src/subst.cpp | 11 +- protocols/EmLanProto/src/amdproto.cpp | 2 +- protocols/Gadu-Gadu/src/core.cpp | 11 +- protocols/Gadu-Gadu/src/gg.h | 1 - protocols/Gadu-Gadu/src/gg_proto.cpp | 13 +- protocols/Gadu-Gadu/src/gg_proto.h | 1 - protocols/ICQ-WIM/src/ignore.cpp | 12 - protocols/ICQ-WIM/src/proto.cpp | 15 +- protocols/ICQ-WIM/src/proto.h | 1 - protocols/ICQCorp/src/protocol.cpp | 75 ------ protocols/ICQCorp/src/protocol.h | 2 - protocols/ICQCorp/src/services.cpp | 29 --- protocols/JabberG/src/jabber_proto.cpp | 41 --- protocols/JabberG/src/jabber_proto.h | 1 - protocols/Weather/src/weather_svcs.cpp | 2 +- protocols/WebView/src/webview_services.cpp | 2 +- src/core/stdmsg/src/msgdialog.cpp | 7 - src/mir_app/mir_app.vcxproj | 1 - src/mir_app/mir_app.vcxproj.filters | 3 - src/mir_app/res/resource.rc | 13 - src/mir_app/src/mir_app.def | 1 - src/mir_app/src/mir_app64.def | 1 - src/mir_app/src/modules.cpp | 2 - src/mir_app/src/proto_interface.cpp | 5 - src/mir_app/src/proto_internal.cpp | 6 - src/mir_app/src/protocols.cpp | 2 - src/mir_app/src/resource.h | 2 - src/mir_app/src/visibility.cpp | 289 ---------------------- 61 files changed, 22 insertions(+), 764 deletions(-) delete mode 100644 src/mir_app/src/visibility.cpp diff --git a/include/m_protoint.h b/include/m_protoint.h index d075c1827d..bd40df552b 100644 --- a/include/m_protoint.h +++ b/include/m_protoint.h @@ -242,7 +242,6 @@ public: virtual HANDLE SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t **ppszFiles); virtual int SendMsg(MCONTACT hContact, MEVENT hReplyEvent, const char *msg); - virtual int SetApparentMode(MCONTACT hContact, int mode); virtual int SetStatus(int iNewStatus); virtual HANDLE GetAwayMsg(MCONTACT hContact); diff --git a/include/m_protosvc.h b/include/m_protosvc.h index 7c312217dc..f89a4e6cff 100644 --- a/include/m_protosvc.h +++ b/include/m_protosvc.h @@ -57,10 +57,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define PF1_MODEMSGRECV 0x00000080 // supports reading others' away messages #define PF1_SERVERCLIST 0x00000100 // contact lists are stored on the server, not locally. See notes below #define PF1_AUTHREQ 0x00000200 // will get authorisation requests for some or all contacts -#define PF1_VISLIST 0x00000800 // has an invisible list -#define PF1_INVISLIST 0x00001000 // has a visible list for when in invisible mode -#define PF1_INDIVSTATUS 0x00002000 // supports setting different status modes to each contact -#define PF1_EXTENSIBLE 0x00004000 // the protocol is extensible and supports plugin-defined messages #define PF1_PEER2PEER 0x00008000 // supports direct (not server mediated) communication between clients #define PF1_NEWUSER 0x00010000 // supports creation of new user IDs #define PF1_CHAT 0x00020000 // has a realtime chat capability @@ -671,18 +667,6 @@ struct PROTOFILERESUME #define PSS_FILE "/SendFile" -/////////////////////////////////////////////////////////////////////////////// -// Set the status mode you will appear in to a user -// wParam = statusMode -// lParam = 0 -// Returns 0 on success, nonzero on failure -// Set statusMode = 0 to revert to normal behaviour for the contact -// ID_STATUS_ONLINE is possible iff PF1_VISLIST -// ID_STATUS_OFFLINE is possible iff PF1_INVISLIST -// Other modes are possible iff PF1_INDIVSTATUS - -#define PSS_SETAPPARENTMODE "/SetApparentMode" - /////////////////////////////////////////////////////////////////////////////// // Send an auth request // wParam = 0 diff --git a/libs/win32/mir_app.lib b/libs/win32/mir_app.lib index 1e603f9851..90c5625b72 100644 Binary files a/libs/win32/mir_app.lib and b/libs/win32/mir_app.lib differ diff --git a/libs/win64/mir_app.lib b/libs/win64/mir_app.lib index edfe9d3eb1..d8752d5f06 100644 Binary files a/libs/win64/mir_app.lib and b/libs/win64/mir_app.lib differ diff --git a/plugins/AVS/src/poll.cpp b/plugins/AVS/src/poll.cpp index 80b1e46ae3..010235afa2 100644 --- a/plugins/AVS/src/poll.cpp +++ b/plugins/AVS/src/poll.cpp @@ -93,8 +93,7 @@ static BOOL PollCheckProtocol(const char *szProto) static BOOL PollContactCanHaveAvatar(MCONTACT hContact, const char *szProto) { int status = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE); - return (Proto_IsFetchingWhenContactOfflineAllowed(szProto) || status != ID_STATUS_OFFLINE) - && Contact::OnList(hContact) && db_get_b(hContact, "CList", "ApparentMode", 0) != ID_STATUS_OFFLINE; + return (Proto_IsFetchingWhenContactOfflineAllowed(szProto) || status != ID_STATUS_OFFLINE) && Contact::OnList(hContact); } // Return true if this contact has to be checked diff --git a/plugins/Clist_modern/src/modern_awaymsg.cpp b/plugins/Clist_modern/src/modern_awaymsg.cpp index cf8897d329..caada9b0dc 100644 --- a/plugins/Clist_modern/src/modern_awaymsg.cpp +++ b/plugins/Clist_modern/src/modern_awaymsg.cpp @@ -90,9 +90,7 @@ static void amThreadProc(void *) ClcCacheEntry *pdnce = Clist_GetCacheEntry(hContact); - HANDLE ACK = nullptr; - if (pdnce->ApparentMode != ID_STATUS_OFFLINE) //don't ask if contact is always invisible (should be done with protocol) - ACK = (HANDLE)ProtoChainSend(hContact, PSS_GETAWAYMSG, 0, 0); + HANDLE ACK = (HANDLE)ProtoChainSend(hContact, PSS_GETAWAYMSG, 0, 0); if (!ACK) { ACKDATA ack; ack.hContact = hContact; diff --git a/plugins/Clist_modern/src/modern_clc.h b/plugins/Clist_modern/src/modern_clc.h index 4d06174025..9245fae6aa 100644 --- a/plugins/Clist_modern/src/modern_clc.h +++ b/plugins/Clist_modern/src/modern_clc.h @@ -94,8 +94,6 @@ void clcSetDelayTimer(UINT_PTR uIDEvent, HWND hwnd, int nDelay = -1); #define DROPTARGET_ONSUBCONTACT 7 #define CONTACTF_ONLINE 1 -#define CONTACTF_INVISTO 2 -#define CONTACTF_VISTO 4 #define CONTACTF_NOTONLIST 8 #define CONTACTF_CHECKED 16 #define CONTACTF_IDLE 32 diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp index 8ee400d56b..cb958b7857 100644 --- a/plugins/Clist_modern/src/modern_clcitems.cpp +++ b/plugins/Clist_modern/src/modern_clcitems.cpp @@ -75,10 +75,6 @@ void AddSubcontacts(ClcData *dat, ClcContact *cont, BOOL showOfflineHereGroup) char *szProto = pdnce->szProto; if (szProto != nullptr && !Clist_IsHiddenMode(dat, wStatus)) p.flags |= CONTACTF_ONLINE; - int apparentMode = szProto != nullptr ? pdnce->ApparentMode : 0; - if (apparentMode == ID_STATUS_OFFLINE) p.flags |= CONTACTF_INVISTO; - else if (apparentMode == ID_STATUS_ONLINE) p.flags |= CONTACTF_VISTO; - else if (apparentMode) p.flags |= CONTACTF_VISTO | CONTACTF_INVISTO; if (pdnce->NotOnList) p.flags |= CONTACTF_NOTONLIST; int idleMode = szProto != nullptr ? pdnce->IdleTS : 0; if (idleMode) p.flags |= CONTACTF_IDLE; @@ -132,19 +128,6 @@ static void _LoadDataToContact(ClcContact *cont, ClcCacheEntry *pdnce, ClcGroup if (szProto != nullptr && !Clist_IsHiddenMode(dat, pdnce->m_iStatus)) cont->flags |= CONTACTF_ONLINE; - uint16_t apparentMode = szProto != nullptr ? pdnce->ApparentMode : 0; - if (apparentMode) - switch (apparentMode) { - case ID_STATUS_OFFLINE: - cont->flags |= CONTACTF_INVISTO; - break; - case ID_STATUS_ONLINE: - cont->flags |= CONTACTF_VISTO; - break; - default: - cont->flags |= CONTACTF_VISTO | CONTACTF_INVISTO; - } - if (pdnce->NotOnList) cont->flags |= CONTACTF_NOTONLIST; @@ -331,7 +314,6 @@ ClcCacheEntry* cliCreateCacheItem(MCONTACT hContact) pdnce->m_bIsSub = db_mc_isSub(hContact) != 0; pdnce->m_bNoHiddenOffline = g_plugin.getByte(hContact, "noOffline"); pdnce->IdleTS = db_get_dw(hContact, pdnce->szProto, "IdleTS", 0); - pdnce->ApparentMode = db_get_w(hContact, pdnce->szProto, "ApparentMode", 0); pdnce->NotOnList = !Contact::OnList(hContact); pdnce->IsExpanded = g_plugin.getByte(hContact, "Expanded"); pdnce->dwLastOnlineTime = db_get_dw(hContact, pdnce->szProto, "LastSeen", 0); diff --git a/plugins/Clist_modern/src/modern_clist.h b/plugins/Clist_modern/src/modern_clist.h index c04ab2562b..e794394c05 100644 --- a/plugins/Clist_modern/src/modern_clist.h +++ b/plugins/Clist_modern/src/modern_clist.h @@ -79,7 +79,6 @@ struct ClcCacheEntry : public ClcCacheEntryBase bool m_bIsSub; bool m_bIsUnknown; - int ApparentMode; int NotOnList; int IdleTS; void* ClcContact; diff --git a/plugins/Clist_modern/src/modern_clistsettings.cpp b/plugins/Clist_modern/src/modern_clistsettings.cpp index 0f5ea19bb5..24bea1d207 100644 --- a/plugins/Clist_modern/src/modern_clistsettings.cpp +++ b/plugins/Clist_modern/src/modern_clistsettings.cpp @@ -147,8 +147,6 @@ int ContactSettingChanged(WPARAM hContact, LPARAM lParam) if ((g_plugin.secondLine.getType() == TEXT_STATUS_MESSAGE || g_plugin.thirdLine.getType() == TEXT_STATUS_MESSAGE) && pdnce->hContact && pdnce->szProto) amRequestAwayMsg(hContact); } - else if (!strcmp(cws->szSetting, "ApparentMode")) - pdnce->ApparentMode = cws->value.wVal; else if (!strcmp(cws->szSetting, "IdleTS")) pdnce->IdleTS = cws->value.dVal; else if (!strcmp(cws->szSetting, "IsSubcontact")) { diff --git a/plugins/Clist_modern/src/resource.h b/plugins/Clist_modern/src/resource.h index 4d98b08646..8e46e99484 100644 --- a/plugins/Clist_modern/src/resource.h +++ b/plugins/Clist_modern/src/resource.h @@ -32,7 +32,6 @@ #define IDI_FILLEDBLOB 212 #define IDI_EMPTYBLOB 213 #define IDD_OPT_IGNORE 214 -#define IDD_OPT_VISIBILITY 215 #define IDC_DROPUSER 215 #define IDI_DETAILSLOGO 216 #define IDI_HIDE_AVATAR 217 diff --git a/plugins/FloatingContacts/src/main.cpp b/plugins/FloatingContacts/src/main.cpp index a1265dba97..21ae19ad5f 100644 --- a/plugins/FloatingContacts/src/main.cpp +++ b/plugins/FloatingContacts/src/main.cpp @@ -228,8 +228,6 @@ static int OnContactSettingChanged(WPARAM hContact, LPARAM lParam) // Only on these 2 events we need to refresh if (0 == strcmp(pdbcws->szSetting, "Status")) idStatus = pdbcws->value.wVal; - else if (0 == strcmp(pdbcws->szSetting, "ApparentMode")) - idStatus = GetContactStatus(hContact); else if (0 == strcmp(pdbcws->szSetting, "Nick")) idStatus = GetContactStatus(hContact); else if (0 == strcmp(pdbcws->szSetting, "MyHandle")) diff --git a/plugins/FloatingContacts/src/thumbs.cpp b/plugins/FloatingContacts/src/thumbs.cpp index 51e7e5d3cd..39da92f65f 100644 --- a/plugins/FloatingContacts/src/thumbs.cpp +++ b/plugins/FloatingContacts/src/thumbs.cpp @@ -247,18 +247,8 @@ void ThumbInfo::ResizeThumb() if (Contact::OnList(hContact)) { char *szProto = Proto_GetBaseAccountName(hContact); if (nullptr != szProto) { - int nStatus = Proto_GetStatus(szProto); int nContactStatus = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE); - int nApparentMode = db_get_w(hContact, szProto, "ApparentMode", 0); - - if ((nStatus == ID_STATUS_INVISIBLE && nApparentMode == ID_STATUS_ONLINE) || - (nStatus != ID_STATUS_INVISIBLE && nApparentMode == ID_STATUS_OFFLINE)) { - if (ID_STATUS_OFFLINE == nContactStatus) - index = FLT_FONTID_OFFINVIS; - else - index = FLT_FONTID_INVIS; - } - else if (ID_STATUS_OFFLINE == nContactStatus) + if (ID_STATUS_OFFLINE == nContactStatus) index = FLT_FONTID_OFFLINE; else index = FLT_FONTID_CONTACTS; @@ -575,23 +565,9 @@ void ThumbInfo::UpdateContent() if (Contact::OnList(hContact)) { char *szProto = Proto_GetBaseAccountName(hContact); if (nullptr != szProto) { - int nStatus = Proto_GetStatus(szProto); int nContactStatus = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE); - int nApparentMode = db_get_w(hContact, szProto, "ApparentMode", 0); - - if ((nStatus == ID_STATUS_INVISIBLE && nApparentMode == ID_STATUS_ONLINE) || - (nStatus != ID_STATUS_INVISIBLE && nApparentMode == ID_STATUS_OFFLINE)) { - if (ID_STATUS_OFFLINE == nContactStatus) - index = FLT_FONTID_OFFINVIS; - else { - index = FLT_FONTID_INVIS; - if (fcOpt.bShowIdle && db_get_dw(hContact, szProto, "IdleTS", 0)) - fStyle |= ILD_BLEND50; - } - } - else if (ID_STATUS_OFFLINE == nContactStatus) { + if (ID_STATUS_OFFLINE == nContactStatus) index = FLT_FONTID_OFFLINE; - } else { index = FLT_FONTID_CONTACTS; if (fcOpt.bShowIdle && db_get_dw(hContact, szProto, "IdleTS", 0)) diff --git a/plugins/MenuItemEx/res/resource.rc b/plugins/MenuItemEx/res/resource.rc index a21a9df1ba..4c0eb66367 100644 --- a/plugins/MenuItemEx/res/resource.rc +++ b/plugins/MenuItemEx/res/resource.rc @@ -62,7 +62,6 @@ EXSTYLE WS_EX_CONTROLPARENT FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN GROUPBOX "Shown menu items",IDC_STATIC,7,3,266,151 - CONTROL "Visibility",IDC_VIS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,18,131,10 CONTROL "Show alpha icons",IDC_SHOWALPHAICONS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,151,18,116,10 CONTROL "Hide from list",IDC_HIDE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,30,251,10 CONTROL "Ignore",IDC_IGNORE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,42,253,10 diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp index fdca3118e8..4cbf357fbd 100644 --- a/plugins/MenuItemEx/src/main.cpp +++ b/plugins/MenuItemEx/src/main.cpp @@ -1,7 +1,5 @@ #include "stdafx.h" -#define MS_SETINVIS "MenuEx/SetInvis" -#define MS_SETVIS "MenuEx/SetVis" #define MS_HIDE "MenuEx/Hide" #define MS_IGNORE "MenuEx/Ignore" #define MS_PROTO "MenuEx/ChangeProto" @@ -12,9 +10,9 @@ #define MS_COPYMIRVER "MenuEx/CopyMirVer" #define MS_OPENIGNORE "MenuEx/OpenIgnoreOptions" -const int vf_default = VF_VS | VF_HFL | VF_IGN | VF_CID | VF_SHOWID | VF_RECV | VF_STAT | VF_SMNAME | VF_CIDN | VF_CIP; +const int vf_default = VF_HFL | VF_IGN | VF_CID | VF_SHOWID | VF_RECV | VF_STAT | VF_SMNAME | VF_CIDN | VF_CIP; -HGENMENU hmenuVis, hmenuOff, hmenuHide, hmenuIgnore, hmenuProto; +HGENMENU hmenuOff, hmenuHide, hmenuIgnore, hmenuProto; HGENMENU hmenuCopyID, hmenuRecvFiles, hmenuStatusMsg, hmenuCopyIP, hmenuCopyMirVer; static HGENMENU hIgnoreItem[9], hProtoItem[MAX_PROTOS]; HICON hIcons[5]; @@ -305,22 +303,6 @@ static BOOL isProtoOnline(char *szProto) return (protoStatus > ID_STATUS_OFFLINE && protoStatus < ID_STATUS_IDLE); } -// set the invisible-flag in db -static INT_PTR onSetInvis(WPARAM wparam, LPARAM) -{ - MCONTACT hContact = (MCONTACT)wparam; - ProtoChainSend(hContact, PSS_SETAPPARENTMODE, (db_get_w(hContact, Proto_GetBaseAccountName(hContact), "ApparentMode", 0) == ID_STATUS_OFFLINE) ? 0 : ID_STATUS_OFFLINE, 0); - return 0; -} - -// set visible-flag in db -static INT_PTR onSetVis(WPARAM wparam, LPARAM) -{ - MCONTACT hContact = (MCONTACT)wparam; - ProtoChainSend(hContact, PSS_SETAPPARENTMODE, (db_get_w(hContact, Proto_GetBaseAccountName(hContact), "ApparentMode", 0) == ID_STATUS_ONLINE) ? 0 : ID_STATUS_ONLINE, 0); - return 0; -} - static INT_PTR onHide(WPARAM wparam, LPARAM) { MCONTACT hContact = (MCONTACT)wparam; @@ -328,17 +310,6 @@ static INT_PTR onHide(WPARAM wparam, LPARAM) return 0; } -// following 4 functions should be self-explanatory -static void ModifyVisibleSet(int mode, BOOL alpha) -{ - Menu_ModifyItem(hmenuVis, nullptr, (mode) ? hIcons[1] : (alpha ? hIcons[3] : Skin_GetIconHandle(SKINICON_OTHER_SMALLDOT))); -} - -static void ModifyInvisSet(int mode, BOOL alpha) -{ - Menu_ModifyItem(hmenuOff, nullptr, (mode) ? hIcons[2] : (alpha ? hIcons[4] : Skin_GetIconHandle(SKINICON_OTHER_SMALLDOT))); -} - static void ModifyCopyID(MCONTACT hContact, BOOL bShowID, BOOL bTrimID) { if (isMetaContact(hContact)) { @@ -636,11 +607,9 @@ static int BuildMenu(WPARAM wparam, LPARAM) bIsOnline = isProtoOnline(pszProto); - bool bEnabled = bShowAll || (flags & VF_VS); - Menu_ShowItem(hmenuVis, bEnabled); - Menu_ShowItem(hmenuOff, bEnabled); + Menu_ShowItem(hmenuOff, bShowAll); - bEnabled = bShowAll || (flags & VF_HFL); + bool bEnabled = bShowAll || (flags & VF_HFL); Menu_ShowItem(hmenuHide, bEnabled); if (bEnabled) { if (Contact::IsHidden(hContact)) @@ -704,19 +673,6 @@ static int BuildMenu(WPARAM wparam, LPARAM) Menu_ShowItem(hmenuCopyMirVer, bEnabled); if (bEnabled) ModifyCopyMirVer(hContact); - - if ((bShowAll || (flags & VF_VS)) && pszProto) { - INT_PTR caps = CallProtoService(pszProto, PS_GETCAPS, PFLAGNUM_1, 0); - int apparent = db_get_w(hContact, Proto_GetBaseAccountName(hContact), "ApparentMode", 0); - - Menu_ShowItem(hmenuVis, (caps & PF1_VISLIST) != 0); - if (caps & PF1_VISLIST) - ModifyVisibleSet(apparent == ID_STATUS_ONLINE, flags & VF_SAI); - - Menu_ShowItem(hmenuOff, (caps & PF1_INVISLIST) != 0); - if (caps & PF1_INVISLIST) - ModifyInvisSet(apparent == ID_STATUS_OFFLINE, flags & VF_SAI); - } return 0; } @@ -794,18 +750,6 @@ static int PluginInit(WPARAM, LPARAM) CMenuItem mi(&g_plugin); mi.flags = CMIF_UNICODE; - SET_UID(mi, 0x2616aa3f, 0x535a, 0x464c, 0xbd, 0x26, 0x1b, 0x15, 0xbe, 0xfa, 0x1f, 0xf); - mi.position = 120000; - mi.name.w = LPGENW("Always visible"); - mi.pszService = MS_SETVIS; - hmenuVis = Menu_AddContactMenuItem(&mi); - - SET_UID(mi, 0x7d93de78, 0xb1c, 0x4c51, 0x8c, 0x88, 0x33, 0x72, 0x12, 0xb5, 0xb8, 0xe7); - mi.position++; - mi.name.w = LPGENW("Never visible"); - mi.pszService = MS_SETINVIS; - hmenuOff = Menu_AddContactMenuItem(&mi); - SET_UID(mi, 0x724f6ac0, 0x7f69, 0x407d, 0x85, 0x98, 0x9c, 0x80, 0x32, 0xdb, 0x66, 0x2d); mi.position++; mi.name.w = LPGENW("Hide from list"); @@ -889,8 +833,6 @@ int CMPlugin::Load() { g_plugin.registerIcon(LPGEN("MenuItemEx"), iconList, "miex"); - CreateServiceFunction(MS_SETINVIS, onSetInvis); - CreateServiceFunction(MS_SETVIS, onSetVis); CreateServiceFunction(MS_HIDE, onHide); CreateServiceFunction(MS_IGNORE, onIgnore); CreateServiceFunction(MS_PROTO, onChangeProto); diff --git a/plugins/MenuItemEx/src/options.cpp b/plugins/MenuItemEx/src/options.cpp index cf84d6daa6..b17894b790 100644 --- a/plugins/MenuItemEx/src/options.cpp +++ b/plugins/MenuItemEx/src/options.cpp @@ -10,7 +10,6 @@ static const checkboxes[] = { { IDC_STATUSMSG, VF_STAT }, { IDC_COPYIP, VF_CIP }, { IDC_COPYMIRVER, VF_CMV }, - { IDC_VIS, VF_VS }, { IDC_SHOWALPHAICONS, VF_SAI }, { IDC_HIDE, VF_HFL }, { IDC_IGNORE, VF_IGN }, @@ -27,14 +26,13 @@ class COptDialog : public CDlgBase { uint32_t m_flags; - CCtrlCheck m_chkVis, m_chkAlpha, m_chkHide, m_chkIgnore, m_chkProtos, m_chkRecvFiles, m_chkCopyIP, m_chkCopyMirver, m_chkStatusMsg, + CCtrlCheck m_chkAlpha, m_chkHide, m_chkIgnore, m_chkProtos, m_chkRecvFiles, m_chkCopyIP, m_chkCopyMirver, m_chkStatusMsg, m_chkSMName, m_chkCopyID, m_chkCopyIDName, m_chkShowID, m_chkTrimID, m_chkIgnoreHide; CCtrlLabel m_lblHint; public: COptDialog() : CDlgBase(g_plugin, IDD_OPTIONS), - m_chkVis(this, IDC_VIS), m_chkAlpha(this, IDC_SHOWALPHAICONS), m_chkHide(this, IDC_HIDE), m_chkIgnore(this, IDC_IGNORE), @@ -53,7 +51,6 @@ public: { m_flags = g_plugin.getDword("flags", vf_default); - m_chkVis.OnChange = Callback(this, &COptDialog::onChange_Vis); m_chkIgnore.OnChange = Callback(this, &COptDialog::onChange_Ignore); m_chkStatusMsg.OnChange = Callback(this, &COptDialog::onChange_StatusMsg); m_chkCopyID.OnChange = m_chkShowID.OnChange = Callback(this, &COptDialog::onChange_CopyID); @@ -88,11 +85,6 @@ public: return true; } - void onChange_Vis(CCtrlBase *) - { - m_chkAlpha.Enable(m_chkVis.GetState()); - } - void onChange_Ignore(CCtrlBase *) { m_chkIgnoreHide.Enable(m_chkIgnore.GetState()); diff --git a/plugins/MenuItemEx/src/resource.h b/plugins/MenuItemEx/src/resource.h index c8c493cfaf..a97b5fa080 100644 --- a/plugins/MenuItemEx/src/resource.h +++ b/plugins/MenuItemEx/src/resource.h @@ -16,7 +16,6 @@ #define IDI_COPYIP 121 #define IDI_BROWSE 122 #define IDI_MIRVER 123 -#define IDC_VIS 1000 #define IDC_REASON 1001 #define IDC_HIDE 1002 #define IDC_IGNORE 1003 diff --git a/plugins/MenuItemEx/src/stdafx.h b/plugins/MenuItemEx/src/stdafx.h index 94bf0ea81b..1ff9aa7ce5 100644 --- a/plugins/MenuItemEx/src/stdafx.h +++ b/plugins/MenuItemEx/src/stdafx.h @@ -47,7 +47,6 @@ int OptionsInit(WPARAM, LPARAM); #define MAX_GROUPS 32 #define MAX_IDLEN 16 -#define VF_VS 0x00000001 #define VF_SMNAME 0x00000002 #define VF_HFL 0x00000004 #define VF_IGN 0x00000008 diff --git a/plugins/MirandaG15/src/CAppletManager.cpp b/plugins/MirandaG15/src/CAppletManager.cpp index a4fcb5df39..3ef8bca1c4 100644 --- a/plugins/MirandaG15/src/CAppletManager.cpp +++ b/plugins/MirandaG15/src/CAppletManager.cpp @@ -714,11 +714,6 @@ void CAppletManager::SendTypingNotification(MCONTACT hContact, bool bEnable) if (protoStatus < ID_STATUS_ONLINE) return; - uint32_t protoCaps = CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0); - if (protoCaps & PF1_VISLIST && db_get_w(hContact, szProto, "ApparentMode", 0) == ID_STATUS_OFFLINE) - return; - if (protoCaps & PF1_INVISLIST && protoStatus == ID_STATUS_INVISIBLE && db_get_w(hContact, szProto, "ApparentMode", 0) != ID_STATUS_ONLINE) - return; if (!Contact::OnList(hContact) && !db_get_b(0, "SRMsg", "UnknownTyping", 1)) return; // End user check diff --git a/plugins/NewAwaySysMod/res/NewAwaySys.rc b/plugins/NewAwaySysMod/res/NewAwaySys.rc index 797364bea4..1623cb3944 100644 --- a/plugins/NewAwaySysMod/res/NewAwaySys.rc +++ b/plugins/NewAwaySysMod/res/NewAwaySys.rc @@ -81,8 +81,6 @@ BEGIN CONTROL "",IDC_REPLYDLG_EVENTFILE,"Button",BS_AUTOCHECKBOX | BS_ICON | WS_TABSTOP,145,17,29,12 CONTROL "Don't reply to ICQ contacts",IDC_REPLYDLG_DONTSENDTOICQ, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,21,119,275,10 - CONTROL "Don't reply when I'm invisible to the contact",IDC_REPLYDLG_DONTREPLYINVISIBLE, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,21,107,275,10 CONTROL "Save autoreply to the history",IDC_REPLYDLG_LOGREPLY, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,21,34,275,10 CONTROL "Reply only when Idle",IDC_REPLYDLG_ONLYIDLEREPLY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,21,48,275,10 diff --git a/plugins/NewAwaySysMod/src/AwayOpt.cpp b/plugins/NewAwaySysMod/src/AwayOpt.cpp index b12c350604..3f1778524a 100644 --- a/plugins/NewAwaySysMod/src/AwayOpt.cpp +++ b/plugins/NewAwaySysMod/src/AwayOpt.cpp @@ -579,7 +579,6 @@ INT_PTR CALLBACK AutoreplyOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l EnableAutoreplyOptDlgControls(); // go through case IDC_REPLYDLG_DONTSENDTOICQ: - case IDC_REPLYDLG_DONTREPLYINVISIBLE: case IDC_REPLYDLG_ONLYCLOSEDDLGREPLY: case IDC_REPLYDLG_ONLYIDLEREPLY: case IDC_REPLYDLG_RESETCOUNTERWHENSAMEICON: @@ -1099,7 +1098,6 @@ void InitOptions() g_AutoreplyOptPage.Items.AddElem(new COptItem_Checkbox(IDC_REPLYDLG_EVENTMSG, "ReplyOnEvent", DBVT_BYTE, AUTOREPLY_DEF_REPLYONEVENT, EF_MSG, IDC_REPLYDLG_ENABLEREPLY)); g_AutoreplyOptPage.Items.AddElem(new COptItem_Checkbox(IDC_REPLYDLG_EVENTFILE, "ReplyOnEvent", DBVT_BYTE, AUTOREPLY_DEF_REPLYONEVENT, EF_FILE, IDC_REPLYDLG_ENABLEREPLY)); g_AutoreplyOptPage.Items.AddElem(new COptItem_Checkbox(IDC_REPLYDLG_DONTSENDTOICQ, "DontSendToICQ", DBVT_BYTE, 0, 0, IDC_REPLYDLG_ENABLEREPLY)); - g_AutoreplyOptPage.Items.AddElem(new COptItem_Checkbox(IDC_REPLYDLG_DONTREPLYINVISIBLE, "DontReplyInvisible", DBVT_BYTE, 1, 0, IDC_REPLYDLG_ENABLEREPLY)); g_AutoreplyOptPage.Items.AddElem(new COptItem_Checkbox(IDC_REPLYDLG_LOGREPLY, "LogReply", DBVT_BYTE, 1, 0, IDC_REPLYDLG_ENABLEREPLY)); g_AutoreplyOptPage.Items.AddElem(new COptItem_Checkbox(IDC_REPLYDLG_ONLYIDLEREPLY, "OnlyIdleReply", DBVT_BYTE, 0, 0, IDC_REPLYDLG_ENABLEREPLY)); g_AutoreplyOptPage.Items.AddElem(new COptItem_Checkbox(IDC_REPLYDLG_ONLYCLOSEDDLGREPLY, "OnlyClosedDlgReply", DBVT_BYTE, 1, 0, IDC_REPLYDLG_ENABLEREPLY)); diff --git a/plugins/NewAwaySysMod/src/MsgEventAdded.cpp b/plugins/NewAwaySysMod/src/MsgEventAdded.cpp index 3fbf7fedaf..8262b848bc 100644 --- a/plugins/NewAwaySysMod/src/MsgEventAdded.cpp +++ b/plugins/NewAwaySysMod/src/MsgEventAdded.cpp @@ -187,11 +187,6 @@ int MsgEventAdded(WPARAM hContact, LPARAM lParam) if (!CContactSettings(iMode, hContactForSettings).Autoreply.IncludingParents(szProto) || CContactSettings(iMode, hContactForSettings).Ignore) return 0; - if (AutoreplyOptData.GetValue(IDC_REPLYDLG_DONTREPLYINVISIBLE)) { - uint16_t ApparentMode = db_get_w(hContact, szProto, "ApparentMode", 0); - if ((iMode == ID_STATUS_INVISIBLE && (!(Flags1 & PF1_INVISLIST) || ApparentMode != ID_STATUS_ONLINE)) || (Flags1 & PF1_VISLIST && ApparentMode == ID_STATUS_OFFLINE)) - return 0; - } if (AutoreplyOptData.GetValue(IDC_REPLYDLG_ONLYCLOSEDDLGREPLY)) { if (bMsgWindowIsOpen && bMsgWindowIsOpen != MSGWNDOPEN_UNDEFINED) return 0; diff --git a/plugins/NewAwaySysMod/src/resource.h b/plugins/NewAwaySysMod/src/resource.h index 7e590aab28..eab7730797 100644 --- a/plugins/NewAwaySysMod/src/resource.h +++ b/plugins/NewAwaySysMod/src/resource.h @@ -186,7 +186,6 @@ #define IDC_REPLYDLG_VARS 1165 #define IDC_MOREOPTDLG_UPDATEMSGS 1166 #define IDC_CONTACTSDLG_LIST 1168 -#define IDC_REPLYDLG_DONTREPLYINVISIBLE 1169 #define IDC_REPLYDLG_ONLYIDLEREPLY_COMBO 1170 #define IDC_REPLYDLG_ONLYCLOSEDDLGREPLY 1171 #define IDC_REPLYDLG_RESETCOUNTERWHENSAMEICON 1172 diff --git a/plugins/Scriver/src/msgutils.cpp b/plugins/Scriver/src/msgutils.cpp index 62429f8c9c..2132d124f4 100644 --- a/plugins/Scriver/src/msgutils.cpp +++ b/plugins/Scriver/src/msgutils.cpp @@ -241,13 +241,6 @@ bool CMsgDialog::IsTypingNotificationEnabled() if (protoStatus < ID_STATUS_ONLINE) return FALSE; - uint32_t protoCaps = CallProtoService(m_szProto, PS_GETCAPS, PFLAGNUM_1, 0); - if (protoCaps & PF1_VISLIST && db_get_w(m_hContact, m_szProto, "ApparentMode", 0) == ID_STATUS_OFFLINE) - return FALSE; - - if (protoCaps & PF1_INVISLIST && protoStatus == ID_STATUS_INVISIBLE && db_get_w(m_hContact, m_szProto, "ApparentMode", 0) != ID_STATUS_ONLINE) - return FALSE; - if (!Contact::OnList(m_hContact) && !g_plugin.bTypingUnknown) return FALSE; return TRUE; diff --git a/plugins/SecureIM/src/crypt_check.cpp b/plugins/SecureIM/src/crypt_check.cpp index 7990de8f99..abe32b29a1 100644 --- a/plugins/SecureIM/src/crypt_check.cpp +++ b/plugins/SecureIM/src/crypt_check.cpp @@ -99,18 +99,6 @@ bool isContactInvisible(MCONTACT hContact) if (!db_mc_isSub(hContact) && Contact::IsHidden(hContact)) return true; - pUinKey p = findUinKey(hContact); - if (!p || p->waitForExchange || !p->proto || !p->proto->inspecting) - return false; - - switch (db_get_w(hContact, p->proto->name, "ApparentMode", 0)) { - case 0: - return Proto_GetStatus(p->proto->name) == ID_STATUS_INVISIBLE; - case ID_STATUS_ONLINE: - return false; - case ID_STATUS_OFFLINE: - return true; - } return false; } diff --git a/plugins/ShellExt/src/shlcom.cpp b/plugins/ShellExt/src/shlcom.cpp index ee707d0da8..c27ff9cfdb 100644 --- a/plugins/ShellExt/src/shlcom.cpp +++ b/plugins/ShellExt/src/shlcom.cpp @@ -276,10 +276,6 @@ bool ipcGetSortedContacts(THeaderIPC * ipch, int* pSlot, bool bGroupMode) if (Contact::IsHidden(hContact) || !Contact::OnList(hContact) || Ignore_IsIgnored(hContact, IGNOREEVENT_MESSAGE | IGNOREEVENT_FILE) != 0) continue; } - // is HIT2 off? - if (BST_UNCHECKED == g_plugin.getByte(SHLExt_UseHIT2Contacts, BST_UNCHECKED)) - if (db_get_w(hContact, szProto, "ApparentMode", 0) == ID_STATUS_OFFLINE) - continue; // store pContacts[i].hContact = hContact; diff --git a/plugins/StopSpamMod/src/stopspam.cpp b/plugins/StopSpamMod/src/stopspam.cpp index ec80f97f3b..8ac386e370 100644 --- a/plugins/StopSpamMod/src/stopspam.cpp +++ b/plugins/StopSpamMod/src/stopspam.cpp @@ -45,12 +45,9 @@ int OnDbEventAdded(WPARAM, LPARAM hDbEvent) if (gbIgnoreURL) isMessage = !IsUrlContains(Utf2T(blob.get_reason())); - if (gbInvisDisable) { + if (gbInvisDisable) if (Proto_GetStatus(dbei.szModule) == ID_STATUS_INVISIBLE) isMessage = false; - else if (db_get_w(hContact, dbei.szModule, "ApparentMode", 0) == ID_STATUS_OFFLINE) - isMessage = false; //is it useful ? - } // ...send message if (isMessage) { @@ -119,8 +116,6 @@ int OnDbEventFilterAdd(WPARAM hContact, LPARAM l) if (gbInvisDisable) { if (Proto_GetStatus(dbei->szModule) == ID_STATUS_INVISIBLE) bSendMsg = false; - else if (db_get_w(hContact, dbei->szModule, "ApparentMode", 0) == ID_STATUS_OFFLINE) - bSendMsg = false; //is it useful ? } bool answered = false; if (gbMathExpression) { diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index 6a23ee654a..3bbc6bef60 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -800,15 +800,6 @@ void CMsgDialog::DM_NotifyTyping(int mode) if (protoStatus < ID_STATUS_ONLINE) return; - // check visibility/invisibility lists to not "accidentially" send MTN to contacts who - // should not see them (privacy issue) - uint32_t protoCaps = CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0); - if (protoCaps & PF1_VISLIST && db_get_w(hContact, szProto, "ApparentMode", 0) == ID_STATUS_OFFLINE) - return; - - if (protoCaps & PF1_INVISLIST && protoStatus == ID_STATUS_INVISIBLE && db_get_w(hContact, szProto, "ApparentMode", 0) != ID_STATUS_ONLINE) - return; - // don't send to contacts which are not permanently added to the contact list, // unless the option to ignore added status is set. if (!Contact::OnList(m_hContact) && !g_plugin.bTypingUnknown) diff --git a/plugins/TabSRMM/src/msgdlgother.cpp b/plugins/TabSRMM/src/msgdlgother.cpp index 0aada80e85..c9d095acee 100644 --- a/plugins/TabSRMM/src/msgdlgother.cpp +++ b/plugins/TabSRMM/src/msgdlgother.cpp @@ -1909,13 +1909,7 @@ void CMsgDialog::SendHBitmapAsFile(HBITMAP hbmp) const if ((ID_STATUS_OFFLINE == wMyStatus) || (ID_STATUS_OFFLINE == m_cache->getActiveStatus() && !(typeCaps & PF4_OFFLINEFILES))) fSend = false; - - if (protoCaps & PF1_VISLIST && db_get_w(m_cache->getActiveContact(), szProto, "ApparentMode", 0) == ID_STATUS_OFFLINE) - fSend = false; - - if (protoCaps & PF1_INVISLIST && wMyStatus == ID_STATUS_INVISIBLE && db_get_w(m_cache->getActiveContact(), szProto, "ApparentMode", 0) != ID_STATUS_ONLINE) - fSend = false; - + if (!fSend) { CWarning::show(CWarning::WARN_SENDFILE, MB_OK | MB_ICONEXCLAMATION | CWarning::CWF_NOALLOWHIDE); return; diff --git a/plugins/TipperYM/res/resource.rc b/plugins/TipperYM/res/resource.rc index 85627b5345..ace600f6e4 100644 --- a/plugins/TipperYM/res/resource.rc +++ b/plugins/TipperYM/res/resource.rc @@ -170,10 +170,8 @@ BEGIN "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,108,273,10 CONTROL "Retrieve new status message",IDC_CHK_GETSTATUSMSG, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,123,273,10 - CONTROL "Disable in invisible status",IDC_CHK_DISABLEINVISIBLE, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,27,138,258,10 CONTROL "Retrieve xStatus details if auto-retrieve is disabled",IDC_CHK_RETRIEVEXSTATUS, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,153,273,10 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,138,273,10 GROUPBOX "Status bar and tray tooltip",IDC_STATIC,7,176,284,46 CONTROL "Limit status messages in status bar and tray tooltips to:",IDC_CHK_LIMITMSG, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,189,273,10 diff --git a/plugins/TipperYM/src/options.cpp b/plugins/TipperYM/src/options.cpp index 2cd292dd53..175e9d1ded 100644 --- a/plugins/TipperYM/src/options.cpp +++ b/plugins/TipperYM/src/options.cpp @@ -619,7 +619,6 @@ void LoadOptions() // extra setting opt.bWaitForContent = g_plugin.getByte("WaitForContent", 0) ? true : false; opt.bGetNewStatusMsg = g_plugin.getByte("GetNewStatusMsg", 0) ? true : false; - opt.bDisableIfInvisible = g_plugin.getByte("DisableInvisible", 1) ? true : false; opt.bRetrieveXstatus = g_plugin.getByte("RetrieveXStatus", 0) ? true : false; opt.bOriginalAvatarSize = g_plugin.getByte("OriginalAvSize", 0) ? true : false; opt.bAvatarBorder = g_plugin.getByte("AvatarBorder", 0) ? true : false; @@ -1587,15 +1586,12 @@ INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM CheckDlgButton(hwndDlg, IDC_CHK_WAITFORCONTENT, opt.bWaitForContent ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, IDC_CHK_GETSTATUSMSG, opt.bGetNewStatusMsg ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_CHK_DISABLEINVISIBLE, opt.bDisableIfInvisible ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, IDC_CHK_RETRIEVEXSTATUS, opt.bRetrieveXstatus ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, IDC_CHK_LIMITMSG, opt.bLimitMsg ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, IDC_CHK_ENABLESMILEYS, opt.iSmileyAddFlags & SMILEYADD_ENABLE ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, IDC_CHK_USEPROTOSMILEYS, opt.iSmileyAddFlags & SMILEYADD_USEPROTO ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, IDC_CHK_ONLYISOLATED, opt.iSmileyAddFlags & SMILEYADD_ONLYISOLATED ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, IDC_CHK_RESIZESMILEYS, opt.iSmileyAddFlags & SMILEYADD_RESIZE ? BST_CHECKED : BST_UNCHECKED); - - EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DISABLEINVISIBLE), opt.bGetNewStatusMsg); { BOOL bEnable = opt.iSmileyAddFlags & SMILEYADD_ENABLE; EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_USEPROTOSMILEYS), bEnable); @@ -1646,10 +1642,6 @@ INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM case IDC_CHK_LIMITMSG: EnableWindow(GetDlgItem(hwndDlg, IDC_ED_CHARCOUNT), IsDlgButtonChecked(hwndDlg, IDC_CHK_LIMITMSG)); break; - - case IDC_CHK_GETSTATUSMSG: - EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DISABLEINVISIBLE), IsDlgButtonChecked(hwndDlg, IDC_CHK_GETSTATUSMSG)); - break; } if ((HIWORD(wParam) == BN_CLICKED || HIWORD(wParam) == EN_CHANGE) && (HWND)lParam == GetFocus()) @@ -1683,7 +1675,6 @@ INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM opt.bWaitForContent = IsDlgButtonChecked(hwndDlg, IDC_CHK_WAITFORCONTENT) ? true : false; opt.bGetNewStatusMsg = IsDlgButtonChecked(hwndDlg, IDC_CHK_GETSTATUSMSG) ? true : false; - opt.bDisableIfInvisible = IsDlgButtonChecked(hwndDlg, IDC_CHK_DISABLEINVISIBLE) ? true : false; opt.bRetrieveXstatus = IsDlgButtonChecked(hwndDlg, IDC_CHK_RETRIEVEXSTATUS) ? true : false; opt.bLimitMsg = IsDlgButtonChecked(hwndDlg, IDC_CHK_LIMITMSG) ? true : false; opt.iLimitCharCount = GetDlgItemInt(hwndDlg, IDC_ED_CHARCOUNT, nullptr, FALSE); @@ -1691,7 +1682,6 @@ INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM g_plugin.setDword("SmileyAddFlags", opt.iSmileyAddFlags); g_plugin.setByte("WaitForContent", opt.bWaitForContent ? 1 : 0); g_plugin.setByte("GetNewStatusMsg", opt.bGetNewStatusMsg ? 1 : 0); - g_plugin.setByte("DisableInvisible", opt.bDisableIfInvisible ? 1 : 0); g_plugin.setByte("RetrieveXStatus", opt.bRetrieveXstatus ? 1 : 0); g_plugin.setByte("LimitMsg", opt.bLimitMsg ? 1 : 0); g_plugin.setByte("LimitCharCount", opt.iLimitCharCount); diff --git a/plugins/TipperYM/src/options.h b/plugins/TipperYM/src/options.h index fe3a491f12..cb949ab316 100644 --- a/plugins/TipperYM/src/options.h +++ b/plugins/TipperYM/src/options.h @@ -153,7 +153,6 @@ struct OPTIONS bool bAvatarBorder; bool bWaitForContent; bool bGetNewStatusMsg; - bool bDisableIfInvisible; bool bRetrieveXstatus; bool bLimitMsg; int iLimitCharCount; diff --git a/plugins/TipperYM/src/resource.h b/plugins/TipperYM/src/resource.h index e3f053db01..3555d9b572 100644 --- a/plugins/TipperYM/src/resource.h +++ b/plugins/TipperYM/src/resource.h @@ -84,7 +84,6 @@ #define IDC_CMB_VV 1054 #define IDC_CMB_LH 1055 #define IDC_CMB_VH 1056 -#define IDC_CHK_DISABLEINVISIBLE 1059 #define IDC_CHK_RETRIEVEXSTATUS 1060 #define IDC_TREE_EXTRAICONS 1061 #define IDC_CHK_ENABLESMILEYS 1062 diff --git a/plugins/TipperYM/src/subst.cpp b/plugins/TipperYM/src/subst.cpp index 34ab44cceb..9f929b59fd 100644 --- a/plugins/TipperYM/src/subst.cpp +++ b/plugins/TipperYM/src/subst.cpp @@ -190,17 +190,8 @@ bool CanRetrieveStatusMsg(MCONTACT hContact, char *szProto) if (opt.bGetNewStatusMsg) { int iFlags = CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3, 0); uint16_t wStatus = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE); - if ((CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND) && (iFlags & Proto_Status2Flag(wStatus))) { - iFlags = CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & (PF1_VISLIST | PF1_INVISLIST); - if (opt.bDisableIfInvisible && iFlags) { - int iVisMode = db_get_w(hContact, szProto, "ApparentMode", 0); - int wProtoStatus = Proto_GetStatus(szProto); - if ((iVisMode == ID_STATUS_OFFLINE) || (wProtoStatus == ID_STATUS_INVISIBLE && iVisMode != ID_STATUS_ONLINE)) - return false; - return true; - } + if ((CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND) && (iFlags & Proto_Status2Flag(wStatus))) return true; - } } return false; diff --git a/protocols/EmLanProto/src/amdproto.cpp b/protocols/EmLanProto/src/amdproto.cpp index bc4d7655f1..215f02a24b 100644 --- a/protocols/EmLanProto/src/amdproto.cpp +++ b/protocols/EmLanProto/src/amdproto.cpp @@ -63,7 +63,7 @@ static INT_PTR __cdecl EMPGetCaps(WPARAM wParam, LPARAM) { switch (wParam) { case PFLAGNUM_1: - return PF1_IM | PF1_BASICSEARCH | PF1_ADDSEARCHRES | PF1_PEER2PEER | PF1_INDIVSTATUS | + return PF1_IM | PF1_BASICSEARCH | PF1_ADDSEARCHRES | PF1_PEER2PEER | PF1_MODEMSG | PF1_FILE | PF1_CANRENAMEFILE | PF1_FILERESUME; case PFLAGNUM_2: return PF2_ONLINE | PF2_SHORTAWAY | PF2_LONGAWAY | PF2_LIGHTDND | PF2_HEAVYDND | PF2_FREECHAT; diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp index b7c506df0b..dd2271de69 100644 --- a/protocols/Gadu-Gadu/src/core.cpp +++ b/protocols/Gadu-Gadu/src/core.cpp @@ -1350,12 +1350,10 @@ void GaduProto::notifyuser(MCONTACT hContact, int refresh) if (!hContact) return; - if (isonline() && (uin = (uin_t)getDword(hContact, GG_KEY_UIN, 0))) - { + if (isonline() && (uin = (uin_t)getDword(hContact, GG_KEY_UIN, 0))) { // Check if user should be invisible // Or be blocked ? - if ((getWord(hContact, GG_KEY_APPARENT, (uint16_t)ID_STATUS_ONLINE) == ID_STATUS_OFFLINE) || !Contact::OnList(hContact)) - { + if (!Contact::OnList(hContact)) { gg_EnterCriticalSection(&sess_mutex, "notifyuser", 77, "sess_mutex", 1); if (refresh) { gg_remove_notify_ex(m_sess, uin, GG_USER_NORMAL); @@ -1365,8 +1363,7 @@ void GaduProto::notifyuser(MCONTACT hContact, int refresh) gg_add_notify_ex(m_sess, uin, GG_USER_OFFLINE); gg_LeaveCriticalSection(&sess_mutex, "notifyuser", 77, 1, "sess_mutex", 1); } - else if (getByte(hContact, GG_KEY_BLOCK, 0)) - { + else if (getByte(hContact, GG_KEY_BLOCK, 0)) { gg_EnterCriticalSection(&sess_mutex, "notifyuser", 78, "sess_mutex", 1); if (refresh) gg_remove_notify_ex(m_sess, uin, GG_USER_OFFLINE); @@ -1409,7 +1406,7 @@ void GaduProto::notifyall() int cc = 0; for (auto &hContact : AccContacts()) { if (uins[cc] = getDword(hContact, GG_KEY_UIN, 0)) { - if ((getWord(hContact, GG_KEY_APPARENT, (uint16_t)ID_STATUS_ONLINE) == ID_STATUS_OFFLINE) || !Contact::OnList(hContact)) + if (!Contact::OnList(hContact)) types[cc] = GG_USER_OFFLINE; else if (getByte(hContact, GG_KEY_BLOCK, 0)) types[cc] = GG_USER_BLOCKED; diff --git a/protocols/Gadu-Gadu/src/gg.h b/protocols/Gadu-Gadu/src/gg.h index 757feeda92..301d3fdb2e 100644 --- a/protocols/Gadu-Gadu/src/gg.h +++ b/protocols/Gadu-Gadu/src/gg.h @@ -230,7 +230,6 @@ struct GGGETAVATARDATA #define GG_KEYDEF_GC_POLICY_DEFAULT 0 #define GG_KEY_BLOCK "Block" // Contact is blocked -#define GG_KEY_APPARENT "ApparentMode" // Visible list #define GG_KEY_TIMEDEVIATION "TimeDeviation" // Max time deviation for connections (seconds) #define GG_KEYDEF_TIMEDEVIATION 300 diff --git a/protocols/Gadu-Gadu/src/gg_proto.cpp b/protocols/Gadu-Gadu/src/gg_proto.cpp index 856ce81228..a083507708 100644 --- a/protocols/Gadu-Gadu/src/gg_proto.cpp +++ b/protocols/Gadu-Gadu/src/gg_proto.cpp @@ -155,7 +155,7 @@ INT_PTR GaduProto::GetCaps(int type, MCONTACT) switch (type) { case PFLAGNUM_1: return PF1_IM | PF1_BASICSEARCH | PF1_EXTSEARCH | PF1_EXTSEARCHUI | PF1_SEARCHBYNAME | - PF1_MODEMSG | PF1_NUMERICUSERID | PF1_VISLIST | PF1_FILE; + PF1_MODEMSG | PF1_NUMERICUSERID | PF1_FILE; case PFLAGNUM_2: return PF2_ONLINE | PF2_SHORTAWAY | PF2_HEAVYDND | PF2_FREECHAT | PF2_INVISIBLE | PF2_LONGAWAY; @@ -526,17 +526,6 @@ int GaduProto::SendMsg(MCONTACT hContact, MEVENT, const char *msg) return seq; } -////////////////////////////////////////////////////////// -// visible lists -// -int GaduProto::SetApparentMode(MCONTACT hContact, int mode) -{ - setWord(hContact, GG_KEY_APPARENT, (uint16_t)mode); - notifyuser(hContact, 1); - - return 0; -} - ////////////////////////////////////////////////////////// // sets protocol status // diff --git a/protocols/Gadu-Gadu/src/gg_proto.h b/protocols/Gadu-Gadu/src/gg_proto.h index 75da3bc4f1..f7387f789c 100644 --- a/protocols/Gadu-Gadu/src/gg_proto.h +++ b/protocols/Gadu-Gadu/src/gg_proto.h @@ -48,7 +48,6 @@ struct GaduProto : public PROTO HANDLE SendFile(MCONTACT hContact, const wchar_t* szDescription, wchar_t** ppszFiles) override; int SendMsg(MCONTACT hContact, MEVENT hReplyEvent, const char* msg) override; - int SetApparentMode(MCONTACT hContact, int mode) override; int SetStatus(int iNewStatus) override; HANDLE GetAwayMsg(MCONTACT hContact) override; diff --git a/protocols/ICQ-WIM/src/ignore.cpp b/protocols/ICQ-WIM/src/ignore.cpp index a7b6cfe66b..6dd86c51fb 100644 --- a/protocols/ICQ-WIM/src/ignore.cpp +++ b/protocols/ICQ-WIM/src/ignore.cpp @@ -58,18 +58,6 @@ void CIcqProto::ProcessPermissions(const JSONNode &ev) Contact::Hide(p->m_hContact); m_bIgnoreListEmpty = false; } - - { mir_cslock lck(m_csCache); - for (auto &it : m_arCache) { - int oldMode = getDword(it->m_hContact, "ApparentMode"); - if (oldMode != it->m_iApparentMode) { - if (it->m_iApparentMode == 0) - delSetting(it->m_hContact, "ApparentMode"); - else - setDword(it->m_hContact, "ApparentMode", it->m_iApparentMode); - } - } - } } void CIcqProto::SetPermitDeny(const CMStringW &userId, bool bAllow) diff --git a/protocols/ICQ-WIM/src/proto.cpp b/protocols/ICQ-WIM/src/proto.cpp index dea367270c..68567975b1 100644 --- a/protocols/ICQ-WIM/src/proto.cpp +++ b/protocols/ICQ-WIM/src/proto.cpp @@ -491,7 +491,7 @@ INT_PTR CIcqProto::GetCaps(int type, MCONTACT) switch (type) { case PFLAGNUM_1: nReturn = PF1_IM | PF1_AUTHREQ | PF1_BASICSEARCH | PF1_ADDSEARCHRES | /*PF1_SEARCHBYNAME | TODO */ - PF1_VISLIST | PF1_FILE | PF1_CONTACT | PF1_SERVERCLIST; + PF1_FILE | PF1_CONTACT | PF1_SERVERCLIST; break; case PFLAGNUM_2: @@ -668,16 +668,3 @@ int CIcqProto::UserIsTyping(MCONTACT hContact, int type) << AIMSID(this) << WCHAR_PARAM("t", GetUserId(hContact)) << CHAR_PARAM("typingStatus", (type == PROTOTYPE_SELFTYPING_ON) ? "typing" : "typed")); return 0; } - -//////////////////////////////////////////////////////////////////////////////////////// -// PS_SetApparentMode - sets the visibility status - -int CIcqProto::SetApparentMode(MCONTACT hContact, int iMode) -{ - int oldMode = getWord(hContact, "ApparentMode"); - if (oldMode != iMode) { - setWord(hContact, "ApparentMode", iMode); - SetPermitDeny(GetUserId(hContact), iMode != ID_STATUS_OFFLINE); - } - return 0; -} diff --git a/protocols/ICQ-WIM/src/proto.h b/protocols/ICQ-WIM/src/proto.h index c0339b38aa..44def39b16 100644 --- a/protocols/ICQ-WIM/src/proto.h +++ b/protocols/ICQ-WIM/src/proto.h @@ -435,7 +435,6 @@ class CIcqProto : public PROTO HANDLE SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t **ppszFiles) override; int SendMsg(MCONTACT hContact, MEVENT hReplyEvent, const char *msg) override; - int SetApparentMode(MCONTACT hContact, int mode) override; int SetStatus(int iNewStatus) override; int UserIsTyping(MCONTACT hContact, int type) override; diff --git a/protocols/ICQCorp/src/protocol.cpp b/protocols/ICQCorp/src/protocol.cpp index bdbf79bce3..cb24b1ddf4 100644 --- a/protocols/ICQCorp/src/protocol.cpp +++ b/protocols/ICQCorp/src/protocol.cpp @@ -1151,81 +1151,6 @@ void ICQ::updateContactList() /////////////////////////////////////////////////////////////////////////////// -void ICQ::sendVisibleList() -{ - /* - unsigned int i, numUsers = 0; - ICQUser *u; - - if (statusVal != ID_STATUS_INVISIBLE) return; - - Packet userPacket; - userPacket << ICQ_VERSION - << ICQ_CMDxSND_VISxLIST - << sequenceVal - << sequenceVal - << uin - << (unsigned int)0x00; - - for (i=0; istatusVal != ID_STATUS_OFFLINE && g_plugin.getWord(u->hContact, "ApparentMode") == ID_STATUS_ONLINE) - numUsers++; - } - - if (numUsers == 0) return; - userPacket << (char)numUsers; - - for (i=0; istatusVal != ID_STATUS_OFFLINE && g_plugin.getWord(u->hContact, "ApparentMode") == ID_STATUS_ONLINE) - userPacket << icqUsers[i]->uin; - } - - Netlib_Logf(hNetlibUser, "[udp] sending visible list (%d)\n", sequenceVal); - sendICQ(udpSocket, userPacket, ICQ_CMDxSND_VISxLIST, sequenceVal); - */ -} - -/////////////////////////////////////////////////////////////////////////////// - -void ICQ::sendInvisibleList() -{ - /* - unsigned int i, numUsers = 0; - - Packet userPacket; - userPacket << ICQ_VERSION - << ICQ_CMDxSND_INVISxLIST - << sequenceVal - << sequenceVal - << uin - << (unsigned int)0x00; - - for (i=0; ihContact, "ApparentMode") == ID_STATUS_OFFLINE) - numUsers++; - } - - if (numUsers == 0) return; - userPacket << (char)numUsers; - - for (i=0; ihContact, "ApparentMode") == ID_STATUS_OFFLINE) - userPacket << icqUsers[i]->uin; - } - - Netlib_Logf(hNetlibUser, "[udp] sending invisible list (%d)\n", sequenceVal); - sendICQ(udpSocket, userPacket, ICQ_CMDxSND_INVISxLIST, sequenceVal); - */ -} - -/////////////////////////////////////////////////////////////////////////////// - void ICQ::updateUserList(ICQUser* /*u*/, char /*list*/, char /*add*/) { /* diff --git a/protocols/ICQCorp/src/protocol.h b/protocols/ICQCorp/src/protocol.h index 4e23d7781c..ef1adf9ad6 100644 --- a/protocols/ICQCorp/src/protocol.h +++ b/protocols/ICQCorp/src/protocol.h @@ -165,8 +165,6 @@ public: void requestSystemMsg(); void requestBroadcastMsg(); void updateContactList(); - void sendVisibleList(); - void sendInvisibleList(); void updateUserList(ICQUser *u, char list, char add); void processSystemMessage(Packet &packet, unsigned long checkUin, unsigned short newCommand, time_t timeSent); void ackSYS(unsigned int timeStamp); diff --git a/protocols/ICQCorp/src/services.cpp b/protocols/ICQCorp/src/services.cpp index 253dfb3e42..90a79b090f 100644 --- a/protocols/ICQCorp/src/services.cpp +++ b/protocols/ICQCorp/src/services.cpp @@ -392,34 +392,6 @@ static INT_PTR icqFileResume(WPARAM wParam, LPARAM lParam) /////////////////////////////////////////////////////////////////////////////// -static INT_PTR icqSetApparentMode(WPARAM, LPARAM) -{ - /* - CCSDATA *ccs = (CCSDATA *)lParam; - int oldMode, newMode = ccs->wParam; - ICQUser *u; - - u = icq.getUserByContact(ccs->hContact); - if (u == NULL) return 1; - - oldMode = db_get_w(u->hContact, ICQCORP_PROTONAME, "ApparentMode", 0); - if (newMode == oldMode) return 1; - - Netlib_Logf(hNetlibUser, "[ ] set apparent mode\n"); - - if (newMode == ID_STATUS_ONLINE || newMode == ID_STATUS_OFFLINE) db_set_w(u->hContact, ICQCORP_PROTONAME, "ApparentMode", (uint16_t)newMode); - else db_unset(u->hContact, ICQCORP_PROTONAME, "ApparentMode"); - - if (icq.statusVal <= ID_STATUS_OFFLINE) return 0; - - if (oldMode != 0) icq.updateUserList(u, oldMode == ID_STATUS_OFFLINE ? 1 : 2, 0); - if (newMode != 0) icq.updateUserList(u, newMode == ID_STATUS_OFFLINE ? 1 : 2, 1); - */ - return 0; -} - -/////////////////////////////////////////////////////////////////////////////// - static int icqContactDeleted(WPARAM hContact, LPARAM) { Netlib_Logf(hNetlibUser, "[ ] contact deleted\n"); @@ -469,7 +441,6 @@ int LoadServices() CreateProtoServiceFunction(protoName, PSS_FILEALLOW, icqFileAllow); CreateProtoServiceFunction(protoName, PSS_FILEDENY, icqFileDeny); CreateProtoServiceFunction(protoName, PSS_FILECANCEL, icqFileCancel); - CreateProtoServiceFunction(protoName, PSS_SETAPPARENTMODE, icqSetApparentMode); CreateProtoServiceFunction(protoName, PSR_MESSAGE, icqRecvMessage); CreateProtoServiceFunction(protoName, PSR_AWAYMSG, icqRecvAwayMsg); diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index 63009c39fc..5eda5e8ff9 100644 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -983,47 +983,6 @@ int CJabberProto::SendMsgEx(MCONTACT hContact, const char *pszSrc, XmlNode &m) return id; } -//////////////////////////////////////////////////////////////////////////////////////// -// rSetApparentMode - sets the visibility status - -int CJabberProto::SetApparentMode(MCONTACT hContact, int mode) -{ - if (mode != 0 && mode != ID_STATUS_ONLINE && mode != ID_STATUS_OFFLINE) - return 1; - - int oldMode = getWord(hContact, "ApparentMode", 0); - if (mode == oldMode) - return 1; - - setWord(hContact, "ApparentMode", (uint16_t)mode); - if (!m_bJabberOnline) - return 0; - - ptrA jid(getUStringA(hContact, "jid")); - if (jid == nullptr) - return 0; - - switch (mode) { - case ID_STATUS_ONLINE: - if (m_iStatus == ID_STATUS_INVISIBLE || oldMode == ID_STATUS_OFFLINE) - m_ThreadInfo->send(XmlNode("presence") << XATTR("to", jid)); - break; - case ID_STATUS_OFFLINE: - if (m_iStatus != ID_STATUS_INVISIBLE || oldMode == ID_STATUS_ONLINE) - SendPresenceTo(ID_STATUS_INVISIBLE, jid); - break; - case 0: - if (oldMode == ID_STATUS_ONLINE && m_iStatus == ID_STATUS_INVISIBLE) - SendPresenceTo(ID_STATUS_INVISIBLE, jid); - else if (oldMode == ID_STATUS_OFFLINE && m_iStatus != ID_STATUS_INVISIBLE) - SendPresenceTo(m_iStatus, jid); - break; - } - - // TODO: update the zebra list (jabber:iq:privacy) - return 0; -} - //////////////////////////////////////////////////////////////////////////////////////// // JabberSetStatus - sets the protocol status diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h index 54359d8d8c..824ad6c929 100644 --- a/protocols/JabberG/src/jabber_proto.h +++ b/protocols/JabberG/src/jabber_proto.h @@ -141,7 +141,6 @@ struct CJabberProto : public PROTO, public IJabberInterface int SendMsg(MCONTACT hContact, MEVENT, const char *msg) override; int SendMsgEx(MCONTACT hContact, const char *msg, XmlNode &m); - int SetApparentMode(MCONTACT hContact, int mode) override; int SetStatus(int iNewStatus) override; HANDLE GetAwayMsg(MCONTACT hContact) override; diff --git a/protocols/Weather/src/weather_svcs.cpp b/protocols/Weather/src/weather_svcs.cpp index c8307ba99a..757e243910 100644 --- a/protocols/Weather/src/weather_svcs.cpp +++ b/protocols/Weather/src/weather_svcs.cpp @@ -59,7 +59,7 @@ INT_PTR WeatherGetCaps(WPARAM wParam, LPARAM) switch (wParam) { case PFLAGNUM_1: // support search and visible list - ret = PF1_BASICSEARCH | PF1_ADDSEARCHRES | PF1_EXTSEARCH | PF1_VISLIST | PF1_MODEMSGRECV; + ret = PF1_BASICSEARCH | PF1_ADDSEARCHRES | PF1_EXTSEARCH | PF1_MODEMSGRECV; break; case PFLAGNUM_2: diff --git a/protocols/WebView/src/webview_services.cpp b/protocols/WebView/src/webview_services.cpp index 2eef900ee9..bbc7fb457f 100644 --- a/protocols/WebView/src/webview_services.cpp +++ b/protocols/WebView/src/webview_services.cpp @@ -199,7 +199,7 @@ INT_PTR GetCaps(WPARAM wParam, LPARAM) { switch (wParam) { case PFLAGNUM_1: - return PF1_BASICSEARCH | PF1_ADDSEARCHRES | PF1_VISLIST; + return PF1_BASICSEARCH | PF1_ADDSEARCHRES; case PFLAGNUM_2: return g_plugin.getByte(HIDE_STATUS_ICON_KEY, 0) ? 0 : (PF2_ONLINE | PF2_SHORTAWAY | PF2_LONGAWAY | PF2_LIGHTDND | PF2_HEAVYDND); case PFLAGNUM_3: diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index 4c13ced6be..30acf7bd06 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -1376,13 +1376,6 @@ void CMsgDialog::NotifyTyping(int mode) Chat_DoEventHook(m_si, GC_USER_TYPNOTIFY, 0, 0, m_nTypeMode); } else { - uint32_t protoCaps = CallProtoService(m_szProto, PS_GETCAPS, PFLAGNUM_1, 0); - if (protoCaps & PF1_VISLIST && db_get_w(m_hContact, m_szProto, "ApparentMode", 0) == ID_STATUS_OFFLINE) - return; - - if (protoCaps & PF1_INVISLIST && protoStatus == ID_STATUS_INVISIBLE && db_get_w(m_hContact, m_szProto, "ApparentMode", 0) != ID_STATUS_ONLINE) - return; - if (!g_plugin.bTypingUnknown && !Contact::OnList(m_hContact)) return; diff --git a/src/mir_app/mir_app.vcxproj b/src/mir_app/mir_app.vcxproj index fa8e33adfb..4cecba6fe2 100644 --- a/src/mir_app/mir_app.vcxproj +++ b/src/mir_app/mir_app.vcxproj @@ -169,7 +169,6 @@ - diff --git a/src/mir_app/mir_app.vcxproj.filters b/src/mir_app/mir_app.vcxproj.filters index bcc2243516..b1c74d0b08 100644 --- a/src/mir_app/mir_app.vcxproj.filters +++ b/src/mir_app/mir_app.vcxproj.filters @@ -107,9 +107,6 @@ Source Files - - Source Files - Source Files diff --git a/src/mir_app/res/resource.rc b/src/mir_app/res/resource.rc index 64f519d355..bc272747c6 100644 --- a/src/mir_app/res/resource.rc +++ b/src/mir_app/res/resource.rc @@ -297,19 +297,6 @@ BEGIN LTEXT "Typing",IDC_STATIC,241,178,66,8,SS_NOPREFIX | SS_CENTERIMAGE END -IDD_OPT_VISIBILITY DIALOGEX 0, 0, 313, 240 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -EXSTYLE WS_EX_CONTROLPARENT -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - GROUPBOX "Visibility",IDC_STATIC,0,0,313,240 - CONTROL "",IDC_LIST,"CListControl",WS_TABSTOP | 0x1d0,8,14,297,183,WS_EX_CLIENTEDGE - ICON IDI_ONLINE,IDC_VISIBLEICON,8,203,20,20,SS_CENTERIMAGE - LTEXT "You are visible to this person even when in invisible mode",IDC_STATIC,26,209,279,8,SS_NOPREFIX | SS_CENTERIMAGE - ICON IDI_INVISIBLE,IDC_INVISIBLEICON,8,218,20,20,SS_CENTERIMAGE - LTEXT "You are never visible to this person",IDC_STATIC,26,224,279,8,SS_NOPREFIX | SS_CENTERIMAGE -END - IDD_ICONINDEX DIALOGEX 0, 0, 219, 197 STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_CONTROLPARENT diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index 8f84e99e5e..4152581314 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -64,7 +64,6 @@ Button_SetSkin_IcoLib @24 ?SendContacts@PROTO_INTERFACE@@UAEHIHHPAI@Z @66 NONAME ?SendFile@PROTO_INTERFACE@@UAEPAXIPB_WPAPA_W@Z @67 NONAME ?SendMsg@PROTO_INTERFACE@@UAEHIIPBD@Z @68 NONAME -?SetApparentMode@PROTO_INTERFACE@@UAEHIH@Z @70 NONAME ?SetAwayMsg@PROTO_INTERFACE@@UAEHHPB_W@Z @71 NONAME ?SetStatus@PROTO_INTERFACE@@UAEHH@Z @72 NONAME ?SetStatusText@CProtoIntDlgBase@@QAEXPB_W@Z @73 NONAME diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index 7eeea9080a..1adcdd89e3 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -64,7 +64,6 @@ Button_SetSkin_IcoLib @24 ?SendContacts@PROTO_INTERFACE@@UEAAHIHHPEAI@Z @66 NONAME ?SendFile@PROTO_INTERFACE@@UEAAPEAXIPEB_WPEAPEA_W@Z @67 NONAME ?SendMsg@PROTO_INTERFACE@@UEAAHIIPEBD@Z @68 NONAME -?SetApparentMode@PROTO_INTERFACE@@UEAAHIH@Z @70 NONAME ?SetAwayMsg@PROTO_INTERFACE@@UEAAHHPEB_W@Z @71 NONAME ?SetStatus@PROTO_INTERFACE@@UEAAHH@Z @72 NONAME ?SetStatusText@CProtoIntDlgBase@@QEAAXPEB_W@Z @73 NONAME diff --git a/src/mir_app/src/modules.cpp b/src/mir_app/src/modules.cpp index 199188a835..757fba4a6a 100644 --- a/src/mir_app/src/modules.cpp +++ b/src/mir_app/src/modules.cpp @@ -52,7 +52,6 @@ int LoadSkinIcons(void); int LoadSkinSounds(void); int LoadSkinHotkeys(void); int LoadUserInfoModule(void); // ui: user info -int LoadVisibilityModule(void); // ui: visibility control int LoadUtilsModule(void); // ui: utils (has a few window classes, like HyperLink) int LoadCLCModule(void); // window class: CLC control @@ -144,7 +143,6 @@ int LoadDefaultModules(void) // order becomes less important below here if (LoadFindAddModule()) return 1; if (LoadIgnoreModule()) return 1; - if (LoadVisibilityModule()) return 1; if (LoadIdleModule()) return 1; return 0; } diff --git a/src/mir_app/src/proto_interface.cpp b/src/mir_app/src/proto_interface.cpp index 3d783df392..43a6f43c2e 100644 --- a/src/mir_app/src/proto_interface.cpp +++ b/src/mir_app/src/proto_interface.cpp @@ -262,11 +262,6 @@ int PROTO_INTERFACE::SendMsg(MCONTACT, MEVENT, const char*) return 0; // error } -int PROTO_INTERFACE::SetApparentMode(MCONTACT, int) -{ - return 1; // error -} - int PROTO_INTERFACE::SetStatus(int) { return 1; // you better declare it diff --git a/src/mir_app/src/proto_internal.cpp b/src/mir_app/src/proto_internal.cpp index b876e221ea..9fc9c45fd7 100644 --- a/src/mir_app/src/proto_internal.cpp +++ b/src/mir_app/src/proto_internal.cpp @@ -215,12 +215,6 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE return (int)ProtoCallService(m_szModuleName, PSS_MESSAGE, 0, (LPARAM)&ccs); } - int SetApparentMode(MCONTACT hContact, int mode) override - { - CCSDATA ccs = { hContact, PSS_SETAPPARENTMODE, (WPARAM)mode, 0 }; - return (int)ProtoCallService(m_szModuleName, PSS_SETAPPARENTMODE, 0, (LPARAM)&ccs); - } - int SetStatus(int iNewStatus) override { return (int)ProtoCallService(m_szModuleName, PS_SETSTATUS, iNewStatus, 0); diff --git a/src/mir_app/src/protocols.cpp b/src/mir_app/src/protocols.cpp index 3da908709c..60e15595b3 100644 --- a/src/mir_app/src/protocols.cpp +++ b/src/mir_app/src/protocols.cpp @@ -67,7 +67,6 @@ static TServiceListItem serviceItems[] = { PSS_CONTACTS, 23 }, { PSS_FILE, 24 }, { PSS_MESSAGE, 25 }, - { PSS_SETAPPARENTMODE, 26 }, { PS_SETSTATUS, 27 }, { PSS_GETAWAYMSG, 28 }, { PSR_AWAYMSG, 29 }, @@ -432,7 +431,6 @@ MIR_APP_DLL(INT_PTR) CallContactService(MCONTACT hContact, const char *szModule, } return msgId; } - case 26: return (INT_PTR)ppi->SetApparentMode(hContact, wParam); case 27: return (INT_PTR)ppi->SetStatus(wParam); case 28: return (INT_PTR)ppi->GetAwayMsg(hContact); case 29: return (INT_PTR)ppi->RecvAwayMsg(hContact, wParam, (PROTORECVEVENT *)lParam); diff --git a/src/mir_app/src/resource.h b/src/mir_app/src/resource.h index b7f4337a30..db1ba527c4 100644 --- a/src/mir_app/src/resource.h +++ b/src/mir_app/src/resource.h @@ -354,8 +354,6 @@ #define IDC_PAGETREE 1186 #define IDC_RUNNOW 1186 #define IDC_GETMORE 1200 -#define IDC_VISIBLEICON 1204 -#define IDC_INVISIBLEICON 1205 #define IDC_FILEICON 1206 #define IDC_ONLINEICON 1207 #define IDC_FILENAMES 1208 diff --git a/src/mir_app/src/visibility.cpp b/src/mir_app/src/visibility.cpp deleted file mode 100644 index 8dab94d294..0000000000 --- a/src/mir_app/src/visibility.cpp +++ /dev/null @@ -1,289 +0,0 @@ -/* - -Miranda NG: the free IM client for Microsoft* Windows* - -Copyright (C) 2012-23 Miranda NG team (https://miranda-ng.org), -Copyright (c) 2000-12 Miranda IM project, -all portions of this codebase are copyrighted to the people -listed in contributors.txt. - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "stdafx.h" - -static void SetListGroupIcons(HWND hwndList, HANDLE hFirstItem, HANDLE hParentItem, int *groupChildCount) -{ - int iconOn[2] = {1, 1}; - int childCount[2] = {0, 0}; - - int typeOfFirst = SendMessage(hwndList, CLM_GETITEMTYPE, (WPARAM)hFirstItem, 0); - //check groups - HANDLE hItem; - if (typeOfFirst == CLCIT_GROUP) - hItem = hFirstItem; - else - hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, (LPARAM)hFirstItem); - - while (hItem) { - HANDLE hChildItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem); - if (hChildItem) SetListGroupIcons(hwndList, hChildItem, hItem, childCount); - for (int i=0; i < _countof(iconOn); i++) - if (iconOn[i] && SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, i) == 0) iconOn[i] = 0; - hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, (LPARAM)hItem); - } - //check contacts - if (typeOfFirst == CLCIT_CONTACT) - hItem = hFirstItem; - else - hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, (LPARAM)hFirstItem); - while (hItem) { - for (int i = 0; i < _countof(iconOn); i++) { - int iImage = SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, i); - if (iconOn[i] && iImage == 0) iconOn[i] = 0; - if (iImage != EMPTY_EXTRA_ICON) - childCount[i]++; - } - hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, (LPARAM)hItem); - } - //set icons - for (int i = 0; i < _countof(iconOn); i++) { - SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hParentItem, MAKELPARAM(i, childCount[i] ? (iconOn[i] ? i + 1 : 0) : EMPTY_EXTRA_ICON)); - if (groupChildCount) groupChildCount[i] += childCount[i]; - } -} - -static void SetAllChildIcons(HWND hwndList, HANDLE hFirstItem, int iColumn, int iImage) -{ - int typeOfFirst = SendMessage(hwndList, CLM_GETITEMTYPE, (WPARAM)hFirstItem, 0); - //check groups - HANDLE hItem; - if (typeOfFirst == CLCIT_GROUP) - hItem = hFirstItem; - else - hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, (LPARAM)hFirstItem); - while (hItem) { - HANDLE hChildItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem); - if (hChildItem) - SetAllChildIcons(hwndList, hChildItem, iColumn, iImage); - hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, (LPARAM)hItem); - } - //check contacts - if (typeOfFirst == CLCIT_CONTACT) - hItem = hFirstItem; - else - hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, (LPARAM)hFirstItem); - while (hItem) { - int iOldIcon = SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, iColumn); - if (iOldIcon != EMPTY_EXTRA_ICON && iOldIcon != iImage) - SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(iColumn, iImage)); - hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, (LPARAM)hItem); - } -} - -static void ResetListOptions(HWND hwndList) -{ - SetWindowLongPtr(hwndList, GWL_STYLE, GetWindowLongPtr(hwndList, GWL_STYLE)|CLS_SHOWHIDDEN); -} - -static void SetAllContactIcons(HWND hwndList) -{ - for (auto &hContact : Contacts()) { - HANDLE hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, hContact, 0); - if (hItem == nullptr) - continue; - - uint32_t flags; - uint16_t status; - char *szProto = Proto_GetBaseAccountName(hContact); - if (szProto == nullptr) { - flags = 0; - status = 0; - } - else { - flags = CallContactService(0, szProto, PS_GETCAPS, PFLAGNUM_1, 0); - status = db_get_w(hContact, szProto, "ApparentMode", 0); - } - - if (flags & PF1_INVISLIST) - if (SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(0, 0)) == EMPTY_EXTRA_ICON) - SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(0, status == ID_STATUS_ONLINE ? 1 : 0)); - - if (flags & PF1_VISLIST) - if (SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(1, 0)) == EMPTY_EXTRA_ICON) - SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(1, status == ID_STATUS_OFFLINE ? 2 : 0)); - } -} - -static INT_PTR CALLBACK DlgProcVisibilityOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM lParam) -{ - static HICON hVisibleIcon, hInvisibleIcon; - static HANDLE hItemAll; - - HIMAGELIST hIml; - - switch (msg) { - case WM_INITDIALOG: - TranslateDialogDefault(hwndDlg); - - hIml = ImageList_Create(g_iIconSX, g_iIconSY, ILC_COLOR32 | ILC_MASK, 3, 3); - ImageList_AddSkinIcon(hIml, SKINICON_OTHER_SMALLDOT); - ImageList_AddSkinIcon(hIml, SKINICON_OTHER_VISIBLE_ALL); - ImageList_AddSkinIcon(hIml, SKINICON_OTHER_INVISIBLE_ALL); - SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_SETEXTRAIMAGELIST, 0, (LPARAM)hIml); - hVisibleIcon = ImageList_GetIcon(hIml, 1, ILD_NORMAL); - SendDlgItemMessage(hwndDlg, IDC_VISIBLEICON, STM_SETICON, (WPARAM)hVisibleIcon, 0); - hInvisibleIcon = ImageList_GetIcon(hIml, 2, ILD_NORMAL); - SendDlgItemMessage(hwndDlg, IDC_INVISIBLEICON, STM_SETICON, (WPARAM)hInvisibleIcon, 0); - - ResetListOptions(GetDlgItem(hwndDlg, IDC_LIST)); - SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_SETEXTRACOLUMNS, 2, 0); - { - CLCINFOITEM cii = { sizeof(cii) }; - cii.flags = CLCIIF_GROUPFONT; - cii.pszText = TranslateT("** All contacts **"); - hItemAll = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_ADDINFOITEM, 0, (LPARAM)&cii); - } - SetAllContactIcons(GetDlgItem(hwndDlg, IDC_LIST)); - SetListGroupIcons(GetDlgItem(hwndDlg, IDC_LIST), (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETNEXTITEM, CLGN_ROOT, 0), hItemAll, nullptr); - return TRUE; - - case WM_SETFOCUS: - SetFocus(GetDlgItem(hwndDlg, IDC_LIST)); - break; - - case WM_NOTIFY: - switch (((LPNMHDR)lParam)->idFrom) { - case IDC_LIST: - switch (((LPNMHDR)lParam)->code) { - case CLN_NEWCONTACT: - case CLN_LISTREBUILT: - SetAllContactIcons(GetDlgItem(hwndDlg, IDC_LIST)); - __fallthrough; - - case CLN_CONTACTMOVED: - SetListGroupIcons(GetDlgItem(hwndDlg, IDC_LIST), (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETNEXTITEM, CLGN_ROOT, 0), hItemAll, nullptr); - break; - - case CLN_OPTIONSCHANGED: - ResetListOptions(GetDlgItem(hwndDlg, IDC_LIST)); - break; - - case NM_CLICK: - // Make sure we have an extra column - NMCLISTCONTROL *nm = (NMCLISTCONTROL*)lParam; - if (nm->iColumn == -1) - break; - - // Find clicked item - uint32_t hitFlags; - HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_HITTEST, (WPARAM)&hitFlags, MAKELPARAM(nm->pt.x, nm->pt.y)); - if (hItem == nullptr) - break; - - // It was not a visbility icon - if (!(hitFlags & CLCHT_ONITEMEXTRA)) - break; - - // Get image in clicked column (0 = none, 1 = visible, 2 = invisible) - int iImage = SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(nm->iColumn, 0)); - if (iImage == 0) - iImage = nm->iColumn + 1; - else if (iImage == 1 || iImage == 2) - iImage = 0; - - // Get item type (contact, group, etc...) - int itemType = SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETITEMTYPE, (WPARAM)hItem, 0); - - // Update list, making sure that the options are mutually exclusive - if (itemType == CLCIT_CONTACT) { // A contact - SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(nm->iColumn, iImage)); - if (iImage && SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(nm->iColumn ? 0 : 1, 0)) != EMPTY_EXTRA_ICON) - SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(nm->iColumn ? 0 : 1, 0)); - } - else if (itemType == CLCIT_INFO) { // All Contacts - SetAllChildIcons(GetDlgItem(hwndDlg, IDC_LIST), hItem, nm->iColumn, iImage); - if (iImage) - SetAllChildIcons(GetDlgItem(hwndDlg, IDC_LIST), hItem, nm->iColumn ? 0 : 1, 0); - } - else if (itemType == CLCIT_GROUP) { // A group - hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem); - if (hItem) { - SetAllChildIcons(GetDlgItem(hwndDlg, IDC_LIST), hItem, nm->iColumn, iImage); - if (iImage) - SetAllChildIcons(GetDlgItem(hwndDlg, IDC_LIST), hItem, nm->iColumn ? 0 : 1, 0); - } - } - // Update the all/none icons - SetListGroupIcons(GetDlgItem(hwndDlg, IDC_LIST), (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETNEXTITEM, CLGN_ROOT, 0), hItemAll, nullptr); - - // Activate Apply button - SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); - } - break; - - case 0: - if (((LPNMHDR)lParam)->code == PSN_APPLY) { - for (auto &hContact : Contacts()) { - HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_FINDCONTACT, hContact, 0); - if (hItem == nullptr) - continue; - - int set = 0; - for (int i = 0; i < 2; i++) { - int iImage = SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(i, 0)); - if (iImage == i + 1) { - ProtoChainSend(hContact, PSS_SETAPPARENTMODE, iImage == 1 ? ID_STATUS_ONLINE : ID_STATUS_OFFLINE, 0); - set = 1; - break; - } - } - if (!set) - ProtoChainSend(hContact, PSS_SETAPPARENTMODE, 0, 0); - } - return TRUE; - } - } - break; - - case WM_DESTROY: - DestroyIcon(hVisibleIcon); - DestroyIcon(hInvisibleIcon); - - hIml = (HIMAGELIST)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETEXTRAIMAGELIST, 0, 0); - ImageList_Destroy(hIml); - break; - } - return FALSE; -} - -static int VisibilityOptInitialise(WPARAM wParam, LPARAM) -{ - OPTIONSDIALOGPAGE odp = {}; - odp.position = 850000000; - odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_VISIBILITY); - odp.szTitle.a = LPGEN("Visibility"); - odp.szGroup.a = LPGEN("Contacts"); - odp.pfnDlgProc = DlgProcVisibilityOpts; - odp.flags = ODPF_BOLDGROUPS; - g_plugin.addOptions(wParam, &odp); - return 0; -} - -int LoadVisibilityModule(void) -{ - HookEvent(ME_OPT_INITIALISE, VisibilityOptInitialise); - return 0; -} -- cgit v1.2.3