From 226f2fceddb5b81d5ba7a16729b4f07e53cfafb4 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 27 Sep 2019 14:40:29 +0300 Subject: obsolete services from m_ignore.h converted into functions --- plugins/CmdLine/src/mimcmd_handlers.cpp | 5 ++++- plugins/IgnoreState/src/main.cpp | 4 ++-- plugins/MenuItemEx/src/main.cpp | 7 +++++-- plugins/NewXstatusNotify/src/main.cpp | 2 +- plugins/Nudge/src/main.cpp | 4 ++-- plugins/SeenPlugin/src/missed.cpp | 2 +- plugins/SeenPlugin/src/utils.cpp | 8 +++++--- plugins/ShellExt/src/shlcom.cpp | 2 +- plugins/TooltipNotify/src/TooltipNotify.cpp | 2 +- plugins/mRadio/i_myservice.inc | 4 ++-- plugins/mRadio/i_search.inc | 2 +- plugins/wbOSD/src/events.cpp | 4 ++-- 12 files changed, 27 insertions(+), 19 deletions(-) (limited to 'plugins') diff --git a/plugins/CmdLine/src/mimcmd_handlers.cpp b/plugins/CmdLine/src/mimcmd_handlers.cpp index 89f1fb131e..4aeaa16d74 100644 --- a/plugins/CmdLine/src/mimcmd_handlers.cpp +++ b/plugins/CmdLine/src/mimcmd_handlers.cpp @@ -1449,7 +1449,10 @@ void HandleIgnoreCommand(PCommand command, TArgument *argv, int argc, PReply rep for (int i = 3; i < argc; i++) { MCONTACT hContact = ParseContactParam(argv[i]); if (hContact) { - CallService(block ? MS_IGNORE_IGNORE : MS_IGNORE_UNIGNORE, (WPARAM)hContact, IGNOREEVENT_ALL); + if (block) + Ignore_Ignore(hContact, IGNOREEVENT_ALL); + else + Ignore_Allow(hContact, IGNOREEVENT_ALL); } } diff --git a/plugins/IgnoreState/src/main.cpp b/plugins/IgnoreState/src/main.cpp index 1776080f67..403c6ed3c5 100644 --- a/plugins/IgnoreState/src/main.cpp +++ b/plugins/IgnoreState/src/main.cpp @@ -72,7 +72,7 @@ INT_PTR isIgnored(MCONTACT hContact, int type) int all = 0, filtered = 0; if (type != IGNOREEVENT_ALL) - return CallService(MS_IGNORE_ISIGNORED, hContact, (LPARAM)type); + return Ignore_IsIgnored(hContact, type); for (int i = 1; i < nII; i++) if (isIgnored(hContact, ii[i].type)) @@ -151,7 +151,7 @@ int CMPlugin::Load() HookEvent(ME_DB_CONTACT_SETTINGCHANGED, onContactSettingChanged); HookEvent(ME_OPT_INITIALISE, onOptInitialise); - //IcoLib support + // IcoLib support g_plugin.registerIcon(LPGEN("Ignore State"), iconList); hExtraIcon = ExtraIcon_RegisterIcolib("ignore", LPGEN("Ignore State"), "ignore_full"); diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp index a8c8a6f3c5..68c10c84f4 100644 --- a/plugins/MenuItemEx/src/main.cpp +++ b/plugins/MenuItemEx/src/main.cpp @@ -630,7 +630,7 @@ static INT_PTR onChangeProto(WPARAM hContact, LPARAM lparam) static int isIgnored(MCONTACT hContact, int type) { if (type != IGNOREEVENT_ALL) - return CallService(MS_IGNORE_ISIGNORED, hContact, (LPARAM)type); + return Ignore_IsIgnored(hContact, (LPARAM)type); int i = 0, all = 0; for (i = 1; i < _countof(ii); i++) @@ -645,7 +645,10 @@ static INT_PTR onIgnore(WPARAM wparam, LPARAM lparam) if (g_plugin.getByte("ignorehide", 0) && (lparam == IGNOREEVENT_ALL)) Clist_HideContact(wparam, !isIgnored((MCONTACT)wparam, lparam)); - CallService(isIgnored((MCONTACT)wparam, lparam) ? MS_IGNORE_UNIGNORE : MS_IGNORE_IGNORE, wparam, lparam); + if (isIgnored(wparam, lparam)) + Ignore_Allow(wparam, lparam); + else + Ignore_Ignore(wparam, lparam); return 0; } diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp index f89d1bb017..7754fd161e 100644 --- a/plugins/NewXstatusNotify/src/main.cpp +++ b/plugins/NewXstatusNotify/src/main.cpp @@ -505,7 +505,7 @@ int ProcessStatus(DBCONTACTWRITESETTING *cws, MCONTACT hContact) } //If *Miranda* ignores the UserOnline event, exit! - if (CallService(MS_IGNORE_ISIGNORED, hContact, IGNOREEVENT_USERONLINE)) + if (Ignore_IsIgnored(hContact, IGNOREEVENT_USERONLINE)) return 0; //If we get here, we have to notify the Hooks. diff --git a/plugins/Nudge/src/main.cpp b/plugins/Nudge/src/main.cpp index d39b12f2e7..4737abcf86 100644 --- a/plugins/Nudge/src/main.cpp +++ b/plugins/Nudge/src/main.cpp @@ -110,7 +110,7 @@ static int NudgeReceived(WPARAM hContact, LPARAM lParam) if (!mir_strcmp(protoName, p->ProtocolName)) { if (p->enabled) { - if (p->useIgnoreSettings && CallService(MS_IGNORE_ISIGNORED, hContact, IGNOREEVENT_USERONLINE)) + if (p->useIgnoreSettings && Ignore_IsIgnored(hContact, IGNOREEVENT_USERONLINE)) return 0; int Status = Proto_GetStatus(protoName); @@ -152,7 +152,7 @@ static int NudgeReceived(WPARAM hContact, LPARAM lParam) } else { if (DefaultNudge.enabled) { - if (DefaultNudge.useIgnoreSettings && CallService(MS_IGNORE_ISIGNORED, hContact, IGNOREEVENT_USERONLINE)) + if (DefaultNudge.useIgnoreSettings && Ignore_IsIgnored(hContact, IGNOREEVENT_USERONLINE)) return 0; DWORD Status = CallService(MS_CLIST_GETSTATUSMODE, 0, 0); diff --git a/plugins/SeenPlugin/src/missed.cpp b/plugins/SeenPlugin/src/missed.cpp index 2faa45bea6..ed5858e88f 100644 --- a/plugins/SeenPlugin/src/missed.cpp +++ b/plugins/SeenPlugin/src/missed.cpp @@ -123,7 +123,7 @@ int Test(WPARAM wparam, LPARAM lparam) if (lparam < ICON_OFFLINE || lparam > ICON_INVIS) return 0; - if (CallService(MS_IGNORE_ISIGNORED, wparam, IGNOREEVENT_USERONLINE)) + if (Ignore_IsIgnored(wparam, IGNOREEVENT_USERONLINE)) return 0; if (g_plugin.getByte((MCONTACT)wparam, "Missed", 0) == 2) diff --git a/plugins/SeenPlugin/src/utils.cpp b/plugins/SeenPlugin/src/utils.cpp index 0bb0111924..a4e37838ea 100644 --- a/plugins/SeenPlugin/src/utils.cpp +++ b/plugins/SeenPlugin/src/utils.cpp @@ -436,7 +436,7 @@ LRESULT CALLBACK PopupDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa void ShowPopup(MCONTACT hcontact, const char * lpzProto, int newStatus) { - if (CallService(MS_IGNORE_ISIGNORED, (WPARAM)hcontact, IGNOREEVENT_USERONLINE)) + if (Ignore_IsIgnored(hcontact, IGNOREEVENT_USERONLINE)) return; if (!g_plugin.getByte("UsePopups", 0) || !Clist_IsHidden(hcontact)) @@ -470,8 +470,10 @@ void ShowPopup(MCONTACT hcontact, const char * lpzProto, int newStatus) void myPlaySound(MCONTACT hcontact, WORD newStatus, WORD oldStatus) { - if (CallService(MS_IGNORE_ISIGNORED, (WPARAM)hcontact, IGNOREEVENT_USERONLINE)) return; - //oldStatus and hcontact are not used yet + if (Ignore_IsIgnored(hcontact, IGNOREEVENT_USERONLINE)) + return; + + // oldStatus and hcontact are not used yet char *soundname = nullptr; if ((newStatus == ID_STATUS_ONLINE) || (newStatus == ID_STATUS_FREECHAT)) soundname = "LastSeenTrackedStatusOnline"; else if (newStatus == ID_STATUS_OFFLINE) soundname = "LastSeenTrackedStatusOffline"; diff --git a/plugins/ShellExt/src/shlcom.cpp b/plugins/ShellExt/src/shlcom.cpp index a71875bfa4..03928e69c5 100644 --- a/plugins/ShellExt/src/shlcom.cpp +++ b/plugins/ShellExt/src/shlcom.cpp @@ -274,7 +274,7 @@ bool ipcGetSortedContacts(THeaderIPC * ipch, int* pSlot, bool bGroupMode) // don't show people who are hidden, "NotOnList" or ignored if (Clist_IsHidden(hContact) || db_get_b(hContact, "CList", "NotOnList", 0) == 1 || - CallService(MS_IGNORE_ISIGNORED, hContact, IGNOREEVENT_MESSAGE | IGNOREEVENT_FILE) != 0) + Ignore_IsIgnored(hContact, IGNOREEVENT_MESSAGE | IGNOREEVENT_FILE) != 0) continue; } // is HIT2 off? diff --git a/plugins/TooltipNotify/src/TooltipNotify.cpp b/plugins/TooltipNotify/src/TooltipNotify.cpp index 1e2e724238..b8349415b9 100644 --- a/plugins/TooltipNotify/src/TooltipNotify.cpp +++ b/plugins/TooltipNotify/src/TooltipNotify.cpp @@ -227,7 +227,7 @@ int CTooltipNotify::ContactSettingChanged(WPARAM hContact, LPARAM lParam) break; case ID_STATUS_ONLINE: - if (CallService(MS_IGNORE_ISIGNORED, hContact, IGNOREEVENT_USERONLINE) && m_sOptions.bConjSOLN) return 0; + if (Ignore_IsIgnored(hContact, IGNOREEVENT_USERONLINE) && m_sOptions.bConjSOLN) return 0; if (!m_sOptions.bOnline) return 0; Skin_PlaySound(SND_ONLINE); break; diff --git a/plugins/mRadio/i_myservice.inc b/plugins/mRadio/i_myservice.inc index d6d7eaa9d9..d53663c024 100644 --- a/plugins/mRadio/i_myservice.inc +++ b/plugins/mRadio/i_myservice.inc @@ -170,7 +170,7 @@ begin AnsiToWide(group,p,MirandaCP); CreateGroupW(p,result); mFreeMem(p); - CallService(MS_IGNORE_IGNORE,result,IGNOREEVENT_ALL); + Ignore_Ignore(result,IGNOREEVENT_ALL); end; end; end; @@ -295,7 +295,7 @@ begin SetStatus(result,ID_STATUS_OFFLINE); - CallService(MS_IGNORE_IGNORE,result,IGNOREEVENT_USERONLINE{IGNOREEVENT_ALL}); + Ignore_Ignore(result,IGNOREEVENT_USERONLINE); CallService(MS_RADIO_COMMAND,MRC_PLAY,result); end; diff --git a/plugins/mRadio/i_search.inc b/plugins/mRadio/i_search.inc index 4073d82d97..6bb67cd658 100644 --- a/plugins/mRadio/i_search.inc +++ b/plugins/mRadio/i_search.inc @@ -431,7 +431,7 @@ begin // SetAvatar(hContact); - CallService(MS_IGNORE_IGNORE,hContact,IGNOREEVENT_USERONLINE{IGNOREEVENT_ALL}); + Ignore_Ignore(hContact,IGNOREEVENT_USERONLINE); result:=hContact; end; end; diff --git a/plugins/wbOSD/src/events.cpp b/plugins/wbOSD/src/events.cpp index 925ad4e588..778d2763b5 100644 --- a/plugins/wbOSD/src/events.cpp +++ b/plugins/wbOSD/src/events.cpp @@ -90,7 +90,7 @@ int ContactSettingChanged(WPARAM wParam, LPARAM lParam) db_set_w(hContact, "UserOnline", "OldStatus2", newStatus); - if (CallService(MS_IGNORE_ISIGNORED, wParam, IGNOREEVENT_USERONLINE)) return 0; + if (Ignore_IsIgnored(wParam, IGNOREEVENT_USERONLINE)) return 0; DWORD dwStatuses = MAKELPARAM(oldStatus, newStatus); NotifyEventHooks(hHookContactStatusChanged, wParam, (LPARAM)dwStatuses); @@ -117,7 +117,7 @@ int ContactStatusChanged(WPARAM wParam, LPARAM lParam) logmsg("ContactStatusChanged2"); - if (db_get_b(hContact, "CList", "NotOnList", 0) || Clist_IsHidden(hContact) || (CallService(MS_IGNORE_ISIGNORED, wParam, IGNOREEVENT_USERONLINE) && newStatus == ID_STATUS_ONLINE)) + if (db_get_b(hContact, "CList", "NotOnList", 0) || Clist_IsHidden(hContact) || (Ignore_IsIgnored(wParam, IGNOREEVENT_USERONLINE) && newStatus == ID_STATUS_ONLINE)) return 0; wchar_t bufferW[512]; -- cgit v1.2.3