diff options
30 files changed, 105 insertions, 120 deletions
diff --git a/include/delphi/m_ignore.inc b/include/delphi/m_ignore.inc index 4007ac03a8..99a08ead4d 100644 --- a/include/delphi/m_ignore.inc +++ b/include/delphi/m_ignore.inc @@ -34,38 +34,6 @@ const IGNOREEVENT_AUTHORIZATION = 4;
IGNOREEVENT_TYPINGNOTIFY = 5;
- {
- wParam : TMCONTACT
- lParam : IGNOREEVENT_*
- Affects: Determines if a message type to a contact should be ignored, see notes
- Returns: 0 if the message type MUST be shown [non zero] if it MUST be ignored
- Notes : TMCONTACT can be NULL(0) to see what to do with a contact
- that isn't on the list (or is unknown in some way)
- don't use the IGNOREEVENT_ALL type!
- Version: v0.1.0.1+
- }
- MS_IGNORE_ISIGNORED:PAnsiChar = 'Ignore/IsIgnored';
-
- {
- wParam : TMCONTACT
- lParam : IGNOREEVENT_* constant
- Affects: Ignore future messages from a contact, see notes
- Returns: 0 on success, [nonzero] on failure
- Notes : wParam: NULL(0) can be used to see if an unknown contact should be
- ignored or not - you can't SET unknown contact's ignore types, this
- is to stop a plugin allowing certain functions (I guess)
- Version: v0.1.0.1+
- }
- MS_IGNORE_IGNORE:PAnsiChar = 'Ignore/Ignore';
-
- {
- wParam : TMCONTACT
- lParam : IGNOREEVENT_*
- Affects: Receive future messages from a contact -- of the given type, see notes
- Returns: 0 on success, non zero on failure
- Notes : Use NULL(0) for TMCONTACT to retrieve the setting for an unknown contact
- Version: v0.1.0.1+
- }
- MS_IGNORE_UNIGNORE:PAnsiChar = 'Ignore/Unignore';
+function Ignore_Ignore(hContact:TMCONTACT; mask:integer) : integer; stdcall; external AppDll;
{$ENDIF}
diff --git a/include/delphi/m_imgsrvc.inc b/include/delphi/m_imgsrvc.inc index ef770733f2..6e764af1e0 100644 --- a/include/delphi/m_imgsrvc.inc +++ b/include/delphi/m_imgsrvc.inc @@ -33,7 +33,7 @@ by the FreeImage project (http://freeimage.sourceforge.net) {$IFNDEF M_IMGSRVC}
{$DEFINE M_IMGSRVC}
-
+const
IMGL_RETURNDIB = 1; // will NOT return a HBITMAP but a FIBITMAP * instead (useful,
// if you want to do further image manipulations before
// converting to a Win32 bitmap caller MUST then free the
diff --git a/include/m_ignore.h b/include/m_ignore.h index b4439727b7..987582a3ef 100644 --- a/include/m_ignore.h +++ b/include/m_ignore.h @@ -25,38 +25,33 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef M_IGNORE_H__
#define M_IGNORE_H__ 1
-//this module provides UI and storage for blocking only, protocol modules are
-//responsible for implementing the block
+#ifndef M_CORE_H__
+#include <m_core.h>
+#endif
-#define IGNOREEVENT_ALL (LPARAM)(-1)
+/////////////////////////////////////////////////////////////////////////////////////////
+// this module provides UI and storage for blocking only, protocol modules are
+// responsible for implementing the block
+
+#define IGNOREEVENT_ALL (int)(-1)
#define IGNOREEVENT_MESSAGE 1
#define IGNOREEVENT_FILE 2
#define IGNOREEVENT_USERONLINE 3
#define IGNOREEVENT_AUTHORIZATION 4
#define IGNOREEVENT_TYPINGNOTIFY 5
-//determines if a message type to a contact should be ignored v0.1.0.1+
-//wParam = (MCONTACT)hContact
-//lParam = message type, an ignoreevent_ constant
-//returns 0 if the message should be shown, or nonzero if it should be ignored
-//Use hContact = NULL to retrieve the setting for unknown contacts (not on the
-//contact list, as either permanent or temporary).
-//don't use ignoreevent_all when calling this service
-#define MS_IGNORE_ISIGNORED "Ignore/IsIgnored"
-
-//ignore future messages from a contact v0.1.0.1+
-//wParam = (MCONTACT)hContact
-//lParam = message type, an ignoreevent_ constant
-//returns 0 on success or nonzero on failure
-//Use hContact = NULL to retrieve the setting for unknown contacts
-#define MS_IGNORE_IGNORE "Ignore/Ignore"
-
-//receive future messages from a contact v0.1.0.1+
-//wParam = (MCONTACT)hContact
-//lParam = message type, an ignoreevent_ constant
-//returns 0 on success or nonzero on failure
-//Use hContact = NULL to retrieve the setting for unknown contacts
-#define MS_IGNORE_UNIGNORE "Ignore/Unignore"
+// determines if a message type to a contact should be ignored
+// mask is one of IGNOREEVENT_* constants
+EXTERN_C MIR_APP_DLL(bool) Ignore_IsIgnored(MCONTACT hContact, int mask);
+
+// ignores certain type of events from a contact
+// returns 0 on success or nonzero on failure
+// Use hContact = 0 to retrieve the setting for unknown contacts
+EXTERN_C MIR_APP_DLL(int) Ignore_Ignore(MCONTACT hContact, int mask);
+// allows certain type of future events from a contact
+// returns 0 on success or nonzero on failure
+// Use hContact = NULL to retrieve the setting for unknown contacts
+EXTERN_C MIR_APP_DLL(int) Ignore_Allow(MCONTACT hContact, int mask);
#endif // M_IGNORE_H__
diff --git a/libs/win32/mir_app.lib b/libs/win32/mir_app.lib Binary files differindex 8dd255cecb..16a99e57b1 100644 --- a/libs/win32/mir_app.lib +++ b/libs/win32/mir_app.lib diff --git a/libs/win64/mir_app.lib b/libs/win64/mir_app.lib Binary files differindex d018b79b8b..70a92bf384 100644 --- a/libs/win64/mir_app.lib +++ b/libs/win64/mir_app.lib 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];
diff --git a/protocols/FacebookRM/src/contacts.cpp b/protocols/FacebookRM/src/contacts.cpp index 5251abe84a..3c42865fe2 100644 --- a/protocols/FacebookRM/src/contacts.cpp +++ b/protocols/FacebookRM/src/contacts.cpp @@ -251,7 +251,7 @@ MCONTACT FacebookProto::AddToContactList(facebook_user* fbu, bool force_add, boo setByte(hContact, FACEBOOK_KEY_CONTACT_TYPE, fbu->type); if (getByte(FACEBOOK_KEY_DISABLE_STATUS_NOTIFY, 0)) - CallService(MS_IGNORE_IGNORE, hContact, (LPARAM)IGNOREEVENT_USERONLINE); + Ignore_Ignore(hContact, IGNOREEVENT_USERONLINE); if (!fbu->real_name.empty()) SaveName(hContact, fbu); diff --git a/protocols/GmailNotifier/src/utility.cpp b/protocols/GmailNotifier/src/utility.cpp index cda56e956c..7049763c55 100644 --- a/protocols/GmailNotifier/src/utility.cpp +++ b/protocols/GmailNotifier/src/utility.cpp @@ -10,7 +10,7 @@ void BuildList(void) Account *p = new Account; p->hContact = hContact; mir_strcpy(p->name, szName); - CallService(MS_IGNORE_IGNORE, hContact, IGNOREEVENT_USERONLINE); + Ignore_Ignore(hContact, IGNOREEVENT_USERONLINE); ptrA szPassword(g_plugin.getStringA(hContact, "Password")); if (szPassword != nullptr) diff --git a/protocols/IRCG/src/commandmonitor.cpp b/protocols/IRCG/src/commandmonitor.cpp index d982705974..c21cdc0e65 100644 --- a/protocols/IRCG/src/commandmonitor.cpp +++ b/protocols/IRCG/src/commandmonitor.cpp @@ -685,7 +685,7 @@ bool CIrcProto::OnIrc_PRIVMSG(const CIrcMessage *pmsg) CONTACT user = { pmsg->prefix.sNick, pmsg->prefix.sUser, pmsg->prefix.sHost, false, false, false };
- if (CallService(MS_IGNORE_ISIGNORED, NULL, IGNOREEVENT_MESSAGE))
+ if (Ignore_IsIgnored(NULL, IGNOREEVENT_MESSAGE))
if (!CList_FindContact(&user))
return true;
@@ -1126,7 +1126,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage *pmsg) }
else {
CONTACT user = { pmsg->prefix.sNick, pmsg->prefix.sUser, pmsg->prefix.sHost, false, false, false };
- if (CallService(MS_IGNORE_ISIGNORED, NULL, IGNOREEVENT_FILE))
+ if (Ignore_IsIgnored(NULL, IGNOREEVENT_FILE))
if (!CList_FindContact(&user))
return true;
diff --git a/protocols/Non-IM Contact/src/contactinfo.cpp b/protocols/Non-IM Contact/src/contactinfo.cpp index 797a328501..6f34ff479b 100644 --- a/protocols/Non-IM Contact/src/contactinfo.cpp +++ b/protocols/Non-IM Contact/src/contactinfo.cpp @@ -339,7 +339,7 @@ INT_PTR CALLBACK DlgProcCopy(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) free(replace); MCONTACT hContact2 = db_add_contact(); Proto_AddToContact(hContact2, MODNAME); - CallService(MS_IGNORE_IGNORE, (WPARAM)hContact2, IGNOREEVENT_USERONLINE); + Ignore_Ignore(hContact2, IGNOREEVENT_USERONLINE); g_plugin.setString(hContact2, "Nick", Translate("New Non-IM Contact")); // blank dbVar2 so the replaceing doesnt crash.. mir_strcpy(dbVar2, ""); @@ -399,7 +399,7 @@ INT_PTR CALLBACK DlgProcCopy(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) return 0; } Proto_AddToContact(hContact2, MODNAME); - CallService(MS_IGNORE_IGNORE, (WPARAM)hContact2, IGNOREEVENT_USERONLINE); + Ignore_Ignore(hContact2, IGNOREEVENT_USERONLINE); g_plugin.setString(hContact2, "Nick", Translate("New Non-IM Contact")); g_plugin.setString(hContact2, "Name", dbVar1); if (!db_get_static(hContact1, MODNAME, "ProgramString", dbVar1, _countof(dbVar1))) @@ -632,7 +632,7 @@ INT_PTR ImportContacts(WPARAM, LPARAM) continue; } Proto_AddToContact(hContact, MODNAME); - CallService(MS_IGNORE_IGNORE, hContact, IGNOREEVENT_USERONLINE); + Ignore_Ignore(hContact, IGNOREEVENT_USERONLINE); g_plugin.setString(hContact, "Nick", Translate("New Non-IM Contact")); g_plugin.setString(hContact, "Name", name); g_plugin.setString(hContact, "ProgramString", program); diff --git a/protocols/Non-IM Contact/src/dialog.cpp b/protocols/Non-IM Contact/src/dialog.cpp index 989f2fdb81..1db80c26df 100644 --- a/protocols/Non-IM Contact/src/dialog.cpp +++ b/protocols/Non-IM Contact/src/dialog.cpp @@ -305,7 +305,7 @@ INT_PTR addContact(WPARAM, LPARAM) char tmp[256]; MCONTACT hContact = db_add_contact(); Proto_AddToContact(hContact, MODNAME); - CallService(MS_IGNORE_IGNORE, hContact, IGNOREEVENT_USERONLINE); + Ignore_Ignore(hContact, IGNOREEVENT_USERONLINE); g_plugin.setWString(hContact, "Nick", TranslateT("New Non-IM Contact")); DoPropertySheet(hContact); if (db_get_static(hContact, MODNAME, "Name", tmp, _countof(tmp))) @@ -321,7 +321,7 @@ INT_PTR editContact(WPARAM wParam, LPARAM) if (!hContact) { hContact = db_add_contact(); Proto_AddToContact(hContact, MODNAME); - CallService(MS_IGNORE_IGNORE, hContact, IGNOREEVENT_USERONLINE); + Ignore_Ignore(hContact, IGNOREEVENT_USERONLINE); g_plugin.setString(hContact, "Nick", Translate("New Non-IM Contact")); } DoPropertySheet(hContact); diff --git a/protocols/Weather/src/weather_addstn.cpp b/protocols/Weather/src/weather_addstn.cpp index 5804f42b00..96ab251cf6 100644 --- a/protocols/Weather/src/weather_addstn.cpp +++ b/protocols/Weather/src/weather_addstn.cpp @@ -66,7 +66,7 @@ INT_PTR WeatherAddToList(WPARAM, LPARAM lParam) MCONTACT hContact = db_add_contact(); Proto_AddToContact(hContact, MODULENAME); // suppress online notification for the new contact - CallService(MS_IGNORE_IGNORE, hContact, IGNOREEVENT_USERONLINE); + Ignore_Ignore(hContact, IGNOREEVENT_USERONLINE); // set contact info and settings wchar_t svc[256]; diff --git a/src/mir_app/src/ignore.cpp b/src/mir_app/src/ignore.cpp index 231e4d5a0f..888aef29e2 100644 --- a/src/mir_app/src/ignore.cpp +++ b/src/mir_app/src/ignore.cpp @@ -340,45 +340,50 @@ static int IgnoreOptInitialise(WPARAM wParam, LPARAM) return 0;
}
-static INT_PTR IsIgnored(WPARAM wParam, LPARAM lParam)
+/////////////////////////////////////////////////////////////////////////////////////////
+
+MIR_APP_DLL(bool) Ignore_IsIgnored(MCONTACT hContact, int idx)
{
- DWORD mask = GetMask(wParam);
- if (lParam < 1 || lParam > IGNOREEVENT_MAX)
+ DWORD mask = GetMask(hContact);
+ if (idx < 1 || idx > IGNOREEVENT_MAX)
return 1;
- return (masks[lParam-1] & mask) != 0;
+ return (masks[idx-1] & mask) != 0;
}
-static INT_PTR Ignore(WPARAM wParam, LPARAM lParam)
+MIR_APP_DLL(int) Ignore_Ignore(MCONTACT hContact, int idx)
{
- DWORD mask = GetMask(wParam);
- if ((lParam < 1 || lParam > IGNOREEVENT_MAX) && lParam != IGNOREEVENT_ALL)
+ DWORD mask = GetMask(hContact);
+ if ((idx < 1 || idx > IGNOREEVENT_MAX) && idx != IGNOREEVENT_ALL)
return 1;
- if (lParam == IGNOREEVENT_ALL)
+
+ if (idx == IGNOREEVENT_ALL)
mask = 0xFFFF;
else
- mask |= masks[lParam-1];
- SaveItemValue(wParam, "Mask1", mask);
+ mask |= masks[idx-1];
+ SaveItemValue(hContact, "Mask1", mask);
return 0;
}
-static INT_PTR Unignore(WPARAM wParam, LPARAM lParam)
+MIR_APP_DLL(int) Ignore_Allow(MCONTACT hContact, int idx)
{
- DWORD mask = GetMask(wParam);
- if ((lParam < 1 || lParam > IGNOREEVENT_MAX) && lParam != IGNOREEVENT_ALL)
+ DWORD mask = GetMask(hContact);
+ if ((idx < 1 || idx > IGNOREEVENT_MAX) && idx != IGNOREEVENT_ALL)
return 1;
- if (lParam == IGNOREEVENT_ALL)
+ if (idx == IGNOREEVENT_ALL)
mask = 0;
else
- mask &= ~(masks[lParam-1]);
- SaveItemValue(wParam, "Mask1", mask);
+ mask &= ~(masks[idx-1]);
+ SaveItemValue(hContact, "Mask1", mask);
return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
static INT_PTR IgnoreRecvMessage(WPARAM wParam, LPARAM lParam)
{
CCSDATA *ccs = (CCSDATA*)lParam;
- if (IsIgnored(ccs->hContact, IGNOREEVENT_MESSAGE))
+ if (Ignore_IsIgnored(ccs->hContact, IGNOREEVENT_MESSAGE))
return 1;
return Proto_ChainRecv(wParam, ccs);
}
@@ -386,7 +391,7 @@ static INT_PTR IgnoreRecvMessage(WPARAM wParam, LPARAM lParam) static INT_PTR IgnoreRecvFile(WPARAM wParam, LPARAM lParam)
{
CCSDATA *ccs = (CCSDATA*)lParam;
- if (IsIgnored(ccs->hContact, IGNOREEVENT_FILE))
+ if (Ignore_IsIgnored(ccs->hContact, IGNOREEVENT_FILE))
return 1;
return Proto_ChainRecv(wParam, ccs);
}
@@ -394,7 +399,7 @@ static INT_PTR IgnoreRecvFile(WPARAM wParam, LPARAM lParam) static INT_PTR IgnoreRecvAuth(WPARAM wParam, LPARAM lParam)
{
CCSDATA *ccs = (CCSDATA*)lParam;
- if (IsIgnored(ccs->hContact, IGNOREEVENT_AUTHORIZATION))
+ if (Ignore_IsIgnored(ccs->hContact, IGNOREEVENT_AUTHORIZATION))
return 1;
return Proto_ChainRecv(wParam, ccs);
}
@@ -407,10 +412,6 @@ int LoadIgnoreModule(void) CreateProtoServiceFunction("Ignore", PSR_FILE, IgnoreRecvFile);
CreateProtoServiceFunction("Ignore", PSR_AUTH, IgnoreRecvAuth);
- CreateServiceFunction(MS_IGNORE_ISIGNORED, IsIgnored);
- CreateServiceFunction(MS_IGNORE_IGNORE, Ignore);
- CreateServiceFunction(MS_IGNORE_UNIGNORE, Unignore);
-
HookEvent(ME_OPT_INITIALISE, IgnoreOptInitialise);
return 0;
}
diff --git a/src/mir_app/src/meta_menu.cpp b/src/mir_app/src/meta_menu.cpp index 5d9a53e492..3c9ac140bd 100644 --- a/src/mir_app/src/meta_menu.cpp +++ b/src/mir_app/src/meta_menu.cpp @@ -100,7 +100,7 @@ void Meta_RemoveContactNumber(DBCachedContact *ccMeta, int number, bool bUpdateI // stop ignoring, if we were
if (g_metaOptions.bSuppressStatus)
- CallService(MS_IGNORE_UNIGNORE, ccSub->contactID, IGNOREEVENT_USERONLINE);
+ Ignore_Allow(ccSub->contactID, IGNOREEVENT_USERONLINE);
}
}
diff --git a/src/mir_app/src/meta_services.cpp b/src/mir_app/src/meta_services.cpp index ad63a46862..769cbdabca 100644 --- a/src/mir_app/src/meta_services.cpp +++ b/src/mir_app/src/meta_services.cpp @@ -478,7 +478,7 @@ int Meta_ContactDeleted(WPARAM hContact, LPARAM) // stop ignoring, if we were
if (g_metaOptions.bSuppressStatus)
- CallService(MS_IGNORE_UNIGNORE, cc->pSubs[i], IGNOREEVENT_USERONLINE);
+ Ignore_Allow(cc->pSubs[i], IGNOREEVENT_USERONLINE);
}
return 0;
}
diff --git a/src/mir_app/src/meta_utils.cpp b/src/mir_app/src/meta_utils.cpp index 7d0cee5982..09c61b98d1 100644 --- a/src/mir_app/src/meta_utils.cpp +++ b/src/mir_app/src/meta_utils.cpp @@ -182,7 +182,7 @@ BOOL Meta_Assign(MCONTACT hSub, MCONTACT hMeta, BOOL set_as_default) // Ignore status if the option is on
if (g_metaOptions.bSuppressStatus)
- CallService(MS_IGNORE_IGNORE, hSub, IGNOREEVENT_USERONLINE);
+ Ignore_Ignore(hSub, IGNOREEVENT_USERONLINE);
NotifyEventHooks(hSubcontactsChanged, hMeta, 0);
return TRUE;
@@ -373,7 +373,7 @@ int Meta_HideLinkedContacts(void) }
if (g_metaOptions.bSuppressStatus)
- CallService(MS_IGNORE_IGNORE, hContact, IGNOREEVENT_USERONLINE);
+ Ignore_Ignore(hContact, IGNOREEVENT_USERONLINE);
MCONTACT hMostOnline = Meta_GetMostOnline(ccMeta); // set nick
Meta_CopyContactNick(ccMeta, hMostOnline);
@@ -393,7 +393,10 @@ int Meta_HideMetaContacts(bool bHide) DBCachedContact *cc = currDb->getCache()->GetCachedContact(hContact);
if (cc->IsSub()) { // show on hide, reverse flag
bSet = !bHide;
- CallService(bSuppress ? MS_IGNORE_IGNORE : MS_IGNORE_UNIGNORE, hContact, IGNOREEVENT_USERONLINE);
+ if (bSuppress)
+ Ignore_Ignore(hContact, IGNOREEVENT_USERONLINE);
+ else
+ Ignore_Allow(hContact, IGNOREEVENT_USERONLINE);
}
else if (cc->IsMeta())
bSet = bHide;
@@ -412,11 +415,15 @@ int Meta_HideMetaContacts(bool bHide) return 0;
}
-int Meta_SuppressStatus(bool suppress)
+int Meta_SuppressStatus(bool bSuppress)
{
for (auto &hContact : Contacts())
- if (db_mc_isSub(hContact))
- CallService((suppress) ? MS_IGNORE_IGNORE : MS_IGNORE_UNIGNORE, hContact, IGNOREEVENT_USERONLINE);
+ if (db_mc_isSub(hContact)) {
+ if (bSuppress)
+ Ignore_Ignore(hContact, IGNOREEVENT_USERONLINE);
+ else
+ Ignore_Allow(hContact, IGNOREEVENT_USERONLINE);
+ }
return 0;
}
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index 8a0d8aaa07..3f53cf195b 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -690,3 +690,6 @@ Clist_GetGroup @775 Clist_SetGroup @776
?ReportSelfAvatarChanged@PROTO_INTERFACE@@QAEXXZ @777 NONAME
Miranda_GetIdle @778 NONAME
+Ignore_Allow @779
+Ignore_Ignore @780
+Ignore_IsIgnored @781
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index d302dbff59..b933dcd83a 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -690,3 +690,6 @@ Clist_GetGroup @775 Clist_SetGroup @776
?ReportSelfAvatarChanged@PROTO_INTERFACE@@QEAAXXZ @777 NONAME
Miranda_GetIdle @778 NONAME
+Ignore_Allow @779
+Ignore_Ignore @780
+Ignore_IsIgnored @781
diff --git a/src/mir_app/src/protocols.cpp b/src/mir_app/src/protocols.cpp index 28a893f770..a717d6f2fe 100644 --- a/src/mir_app/src/protocols.cpp +++ b/src/mir_app/src/protocols.cpp @@ -219,7 +219,7 @@ static INT_PTR Proto_ContactIsTyping(WPARAM wParam, LPARAM lParam) if (!szProto)
return 0;
- if (CallService(MS_IGNORE_ISIGNORED, wParam, IGNOREEVENT_TYPINGNOTIFY))
+ if (Ignore_IsIgnored(wParam, IGNOREEVENT_TYPINGNOTIFY))
return 0;
if (type < PROTOTYPE_CONTACTTYPING_OFF)
|