/* "Spam Filter"-Plugin for Miranda IM: the free IM client for Microsoft* Windows* Copyright 2003-2006 Heiko Herkenrath 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 ("SpamFilter-License.txt"); if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef M_SPAMFILTER_H__ #define M_SPAMFILTER_H__ 1 #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 // Spam Filter Version: 2.5.2.3 // See "spamcheck.c" out of the source code for an example on how to use the spam checking services. // The functionality and the API of Spam Filter is quite complex // and not easy to describe or explain. // If you have any question or extension whishes please send me an e-mail: // hrathh at users.sourceforge.net // Notes: // * All services are fully thread-safe, you can call everything from any thread // (If there are problems with it it is a bug :-) ) // * Unicode parameters can also be passed to the ANSI version of the plugin // and the other way round. The strings get converted as they are needed // using automatic two-way translation. // Unicode support was added in v2.5.0.0 // ------------------------------------------- // -- Getting handles ------------------------ // ------------------------------------------- #define MS_SPAMFILTER_GETHANDLE "SpamFilter/GetHandle" // Description: // ------------- // Gets a specified icon/window handle. // Parameters: // ------------- // wParam = (UINT)uHandleType (see below) // lParam = 0 // Possible values for wParam: #define SFHT_HWND_PLUGIN_OPTIONS 2 // HWND of the "Spam Filter" options dialog (if it is loaded; else NULL) #define SFHT_HICON_SPAM 3 // HICON of the spam icon (small): The returned HICON must be DestroyIcon()ed. // Added in v2.0.2.0: #define SFHT_HICON_SPAM_LARGE 4 // HICON of the spam icon (large): The returned HICON must be DestroyIcon()ed. #define SFHT_HICON_SPAM_LAYER 5 // HICON of the spam layer icon (small): The returned HICON must be DestroyIcon()ed. // Added in v2.1.0.0: #define SFHT_HWND_ADVERTISMENT_FILTER 6 // HWND of the "Advertisment Filter" settings dialog (if it is opened; else NULL) #define SFHT_HWND_ROBOT_FILTER 7 // HWND of the "Robot Filter" settings dialog (if it is opened; else NULL) #define SFHT_HWND_DISLIKEDMESSAGES_FILTER 8 // HWND of the "Disliked Messages Filter" settings dialog (if it is opened; else NULL) // Added in v2.5.0.0: #define SFHT_HWND_SPAMDEFINITIONS_INFO 9 // HWND of the "Spam Definitions" info dialog (if it is opened; else NULL) #define SFHT_HWND_SPAMMERS_INFO 10 // HWND of the Spammers info dialog (if it is opened; else NULL) #define SFHT_BOOL_IS_UNICODE 0 // No handle, returns TRUE if Spam Filter is installed as Unicode version, FALSE otherwise // (You probably never need to call this since Spam Filter performs automatic two-way translation // when a service is called) // Note: Icons are taken directly from resources, they are not skinned by user // Return Values: // -------------- // Returns the specified handle value: HMODULE, HWND, ICON // // Note: // If a handle is not available (or if it was removed) the function will // return NULL. // When you are using this service you need to check always for the // NULL return value. // ------------------------------------------- // -- Activating/Deactivating the filters ---- // ------------------------------------------- #define MS_SPAMFILTER_CHANGEFILTERACTIVATION "SpamFilter/ChangeFilterActivation" // Description: // ------------- // Provides the possibility to enable or disable the spam filters. // Also updates the checkboxes in the spam filter options if the option dialog is opened. // Parameters: // ------------- // wParam = (UINT)uFilterType (For possible values see below) // lParam = (BOOL)bNewState (new activation state of filter) // Possible filter type values (dwFilterType): #define SFT_ADVERTISMENT_FILTER 1 #define SFT_DISLIKEDMESSAGES_FILTER 2 #define SFT_ROBOT_FILTER 3 // Return Values: // -------------- // Returns 0 on success, nonzero on error. // ------------------------------------------- // -- Showing configure dialogs -------------- // ------------------------------------------- #define MS_SPAMFILTER_SHOWFILTERDIALOG "SpamFilter/ShowFilterDialog" // Description: // ------------- // Shows the configure dialog of the specified filter. // Parameters: // ------------- // wParam = (HWND)hwndParent (Can be NULL) // lParam = (UINT)uFilterType (For possible values see above, SFT_*) // -> since 2.0.2.0: If this is zero then the options dialog will be opened pointing to the Spam Filter options. // Note: // If hwndParent is not NULL the function will not return // until the configure dialog is closed. // Since 2.0.2.0: #define SFTEX_OPTIONS_PAGE 0 // Since 2.5.0.0: // Combine the following flag with the lParam/uFilterType parameter // to show the corresponding Spam Definitions info dialog instead // of the settings dialog: #define SFTEXF_SPAMDEFINITIONS_INFO 0x2000 // Note: SFTEXF_SPAMDEFINITIONS_INFO can't be combined with SFT_ROBOT_FILTER // Combine the following flag with the lParam/uFilterType of 0 parameter // to show the Spammers dialog instead of the settings dialog: #define SFTEXF_SPAMMERS_INFO 0x4000 // Note: SFTEXF_SPAMMERS_INFO can't be combined with SFT_* // Return Values: // -------------- // Returns 0 on success, nonzero on error. // Since v2.1.0.0: // If the specified settings window is already opened it will be // brought to front (reactivated) instead (returns success though). // This might be changed however in the future. // Changed behaviour since v2.1.0.0: // If hwndParent was not set then the function returned the handle to the new window. // Now the function returns 0 to indicate success instead. // ------------------------------------------- // -- Adding message types ------------------- // ------------------------------------------- #define MS_SPAMFILTER_REGISTERMESSAGETYPE "SpamFilter/MessageTypes/Register" // Description: // ------------- // Adds a new message type which can be checked for spam. // Associated event: ME_SPAMFILTER_PREREGISTERMESSAGETYPE // Parameters: // ------------- // wParam = 0 // lParam = (MESSAGETYPEDESC*)mtd (see below) // Return Values: // -------------- // Returns 0 on success, nonzero on error. // Already registered message types are: // (With pszSection set to the installed network protocol names, e.g. "ICQ") #define SFMT_AUTHREQUEST "Auth" #define SFMT_ADDED "Added" // since v2.1.0.0 #define SFMT_MESSAGE "Msg" #define SFMT_URL "URL" #define SFMT_FILE "File" #define SFMT_CONTACTS "Contacts" // MESSAGETYPEDESC structure: typedef struct { int cbSize; // Set to sizeof(MESSAGETYPEDESC), in bytes char* pszSection; // Section of message name for database e.g. protocol name (Can not be NULL) // -> should be short, no-spaces, english and untranslated union { char* pszSectionDescription; // Readable name of section e.g. protocol name (can be NULL) WCHAR* ptszSectionDescription; // Ignored if section existed previously WCHAR* pwszSectionDescription; }; HICON hSectionIcon; // Icon to show for section e.g. protocol icon (can be NULL) // -> Can be destroyed after service returns // Ignored if section existed previously char* pszName; // Name to refer to message type when spam checking and in db (Can not be NULL) // -> should be short, no-spaces, english and untranslated union { char* pszDescription; // Description for options dialog (can be NULL) WCHAR* ptszDescription; WCHAR* pwszDescription; }; HICON hIcon; // EITHER: icon handle representing the message type OR: one of mirandas skin constants with a negative sign, e.g (HICON)-SKINICON_EVENT_MESSAGE, same as for LoadSkinnedIcon() -> can be NULL and can also be a normal icon handle (HICON) // -> Can be destroyed after service returns DWORD dwFlags; // Flags for the message type (for possible flags see below) // Added in v2.5.0.0: int iSectionPosition; // Approx position number for the section in the options list, lower numbers are nearer to the top (Can be 0 to be sorted alphabetically) // Ignored if section existed previously (or if pszSection is NULL) int iPosition; // Approx position number for the item in the options list, lower numbers are nearer to the top (Can be 0 to be sorted alphabetically) } MESSAGETYPEDESC; // Possible MESSAGETYPEDESC flags: #define MTDF_DEFAULTDISABLED 0x00000001 // Is disabled by default #define MTDF_HIDDEN 0x00000002 // Does not get shown on the options page // Since v2.5.0.0 #define MTDF_UNICODE 0x00000004 // pszSectionDescription and pszDescription are Unicode strings // MESSAGETYPEDESC struct was enhanced in v2.5.0.0: #define MESSAGETYPEDESC_V2000_SIZE (((int)((LPBYTE)(&((MESSAGETYPEDESC*)0)->dwFlags) - ((LPBYTE)((MESSAGETYPEDESC*)0)))) + sizeof(((MESSAGETYPEDESC*)0)->dwFlags)) #ifndef SPAMFILTER_NOHELPER static int __inline SFRegisterMessageType(const char* section, const WCHAR* sectionDesc, HICON sectionIcon, const char* name, const WCHAR* desc, HICON icon, int pos, DWORD flags) { MESSAGETYPEDESC mtd; mtd.cbSize = sizeof(MESSAGETYPEDESC); mtd.dwFlags = flags|MTDF_UNICODE; mtd.pszSection = (char*)section; mtd.ptszSectionDescription = (WCHAR*)sectionDesc; mtd.hSectionIcon = sectionIcon; mtd.iSectionPosition = 0; // not really needed mtd.pszName = (char*)name; mtd.ptszDescription = (WCHAR*)desc; mtd.hIcon = icon; mtd.iPosition = pos; return CallService(MS_SPAMFILTER_REGISTERMESSAGETYPE, 0, (LPARAM)&mtd); } #endif // ------------------------------------------- // -- Modify new added message type (Event) -- // ------------------------------------------- #define ME_SPAMFILTER_PREREGISTERMESSAGETYPE "SpamFilter/MessageTypes/PreRegister" // Description: // ------------- // Gets fired before a new message type is added. // // This is meant for asking other plugins if the specified default data is ok. // Other plugins (especially protocols) can disable a message type if either sending spam // is not possible for those protocols or if spam checking would cause unwanted side-effects. // Note: Works as it does now since v2.1.1.0 // Warning: Most elements of the MESSAGETYPEDESC structure can also be NULL. // However, the structure was checked for errors before this events gets called. // Parameters: // ----------------- // wParam = 0 (same wParam as used for MS_SPAMFILTER_REGISTERMESSAGETYPE) // lParam = (MESSAGETYPEDESC*)mtd (see above, contents can be modified) // Return Values: // ----------------- // Returning 0 on this event will accept the message type to be added. // Returning 1 will prevent the the message type to be added. // ------------------------------------------- // -- Uninstalling a message type ------------ // ------------------------------------------- #define MS_SPAMFILTER_REMOVEMESSAGETYPE "SpamFilter/MessageTypes/Remove" // Description: // ------------- // Uninstalls a specifed message type. It removes the database setting related to the given message type. // Should only be used for uninstalling purposes (e.g in uninstall function of PluginUninstaller) // Parameters: // ------------- // wParam = (char*)pszMsgTypeName (Message type name; You need to use MS_SPAMFILTER_REGISTERMESSAGETYPE before) // lParam = (char*)pszMsgTypeSection (The section of the message type string; You need to use MS_SPAMFILTER_REGISTERMESSAGETYPE before) // Return Values: // -------------- // Returns 0 on success, nonzero on error. // ------------------------------------------- // -- Message type activation ---------------- // ------------------------------------------- #define MS_SPAMFILTER_ISMESSAGETYPEACTIVATED "SpamFilter/MessageTypes/IsActivated" // Description: // ------------- // Returns if a specified message type is activated or not. // Parameters: // ------------- // wParam = (char*)pszMsgTypeName (Message type name; You need to use MS_SPAMFILTER_REGISTERMESSAGETYPE before) // lParam = (char*)pszMsgTypeSection (The section of the message type string; You need to use MS_SPAMFILTER_REGISTERMESSAGETYPE before) // Return Values: // -------------- // Returns TRUE if the message type is activated and FALSE otherwise. // ------------------------------------------- // -- Reset Auto-ignore counters ------------- // ------------------------------------------- #define MS_SPAMFILTER_RESETAUTOIGNORE "SpamFilter/AutoIgnore/Reset" // Description: // ------------- // Resets the list in which the total number of spam sent by // each user is kept. // The list is necessary to determine when a particular user reached the // allowed spam messages limit. // Parameters: // ------------- // wParam = (BOOL)bOnlyCount (if TRUE the service will only return the user count without doing reset) // lParam = 0 // Return Values: // -------------- // Returns 0 on success, nonzero on error. // ----------------------------------------- // -- Spam Checking ------------------------ // ----------------------------------------- #define MS_SPAMFILTER_ADVERTISMENTCHECK "SpamFilter/AdvertismentCheck" #define MS_SPAMFILTER_DISLIKEDMESSAGESCHECK "SpamFilter/DislikedMessagesCheck" #define MS_SPAMFILTER_ROBOTCHECK "SpamFilter/RobotCheck" // Description: // ------------- // These services provide the possibility to check a specified text for contained spam. // The function checks for everything that is activated in the plugin's options. // Note: These functions work as they do now since v2.1.0.0 // Parameters: // ------------- // wParam = (SPAMCHECKDATA*)scd // lParam = 0 // SPAMCHECKDATA structure: typedef struct { int cbSize; // Set to sizeof(SPAMCHECKDATA) char* pszMsgTypeSection; // The section of the message type string: You need to use MS_SPAMFILTER_REGISTERMESSAGETYPE before char* pszMsgTypeName; // Description of the message: You need to use MS_SPAMFILTER_REGISTERMESSAGETYPE before // Pointer to the text of a message which is checked for spam. Can not be NULL. // (To use Unicode, you need to set the flag SCDF_UNICODE) union { char* pszMsgText; // ANSI WCHAR* ptszMsgText; // Unicode or ANSI WCHAR* pwszMsgText; // Unicode }; DWORD dwFlags; // Flags for the spam checking. (For more details see below.) union { HANDLE hContact; // Handle to the sending contact (use pszUserName instead if no hContact is available) char* pszUserName; // Name of the user, e.g. nick (set SCDF_NO_CONTACT in the flags to use this parameter) WCHAR* ptszUserName; // -"- (Unicode or ANSI) WCHAR* pwszUserName; // -"- (Unicode) // -> UserName should be as unique as possible (To use Unicode you need to specify SCDF_UNICODE) }; } SPAMCHECKDATA; // Possible flags in the SPAMCHECKDATA structure: #define SCDF_NO_NOTIFY 0x00000001 // Don't show a popup, play sound or log to file if the message is spam. #define SCDF_NO_CANCEL 0x00000002 // Do check even if user pressed control key to avoid the spam check manually #define SCDF_NO_AUTOIGNORE 0x00000004 // Do not use the AutoIgnore feature for this check #define SCDF_NO_CONTACT 0x00000008 // Use pszUserName instead of hContact of union // Since v2.5.0.0: #define SCDF_UNICODE 0x00000010 // Specify this flag if associated message text and/or user name is Unicode // Return Values: // -------------- // Possible return flags: #define SFF_MARKREAD 0x00000010 // Flag #define SFF_DELETE 0x00000020 // Flag #define SFF_IGNORE 0x00000040 // Flag #define SFF_SENDMSG_NOTIFY 0x00000100 // Flag, Only MS_SPAMFILTER_DISLIKEDMESSAGESCHECK #define SFF_SENDMSG_INSTRUCTION 0x00000200 // Flag, Only MS_SPAMFILTER_ROBOTCHECK #define SFF_SENDMSG_CONFIRMATION 0x00000400 // Flag, Only MS_SPAMFILTER_ROBOTCHECK #define SFF_TESTPASSED 0x00000080 // Flag, Only MS_SPAMFILTER_ROBOTCHECK #define SFF_ISSPAM 0x00000002 // Flag #define SFF_ISNORMAL 0x00000001 // Flag // Since 2.5.2.0: #define SFF_HIDE 0x00001000 // Flag, Only MS_SPAMFILTER_ROBOTCHECK // ------------------------------------------- // -- Getting additional Check Info ---------- // ------------------------------------------- #define MS_SPAMFILTER_GETSPAMCHECKINFO "SpamFilter/GetSpamCheckInfo" // Description: // ------------- // Gets data needed for the processing of spam messages. // Parameters: // ------------- // wParam = (UINT)uDataType (For possible values see below) // lParam = depends on wParam (see below) // Possible values for lParam: // TRUE/FALSE: if the specified filter is enabled #define SFSCI_ACTIVATION_FILTER 1 // lParam = uFilterType (For possible values see above) // Strings: Get the message texts specified by the user // ANSI #define SFSCI_MSGTEXT_NOTIFYA 2 // lParam = (SPAMCHECKDATA*)scd, scd->hContact (or scd->pszUserName) and scd->pszMsgText (and scd->cbSize) should be filled in. #define SFSCI_MSGTEXT_INSTRUCTIONA 3 // lParam: see SFSCI_MSGTEXT_NOTIFYA #define SFSCI_MSGTEXT_CONFIRMATIONA 4 // lParam: see SFSCI_MSGTEXT_NOTIFYA // Unicode (since v2.5.0.0) #define SFSCI_MSGTEXT_NOTIFYW 6 // lParam = (SPAMCHECKDATA*)scd, scd->hContact (or scd->pwszUserName) and scd->pwszMsgText (and scd->cbSize) should be filled in. #define SFSCI_MSGTEXT_INSTRUCTIONW 7 // lParam: see SFSCI_MSGTEXT_NOTIFYW #define SFSCI_MSGTEXT_CONFIRMATIONW 8 // lParam: see SFSCI_MSGTEXT_NOTIFYW // ANSI/Unicode #if defined(_UNICODE) || defined(UNICODE) #define SFSCI_MSGTEXT_NOTIFY SFSCI_MSGTEXT_NOTIFYW #define SFSCI_MSGTEXT_INSTRUCTION SFSCI_MSGTEXT_INSTRUCTIONW #define SFSCI_MSGTEXT_CONFIRMATION SFSCI_MSGTEXT_CONFIRMATIONW #else #define SFSCI_MSGTEXT_NOTIFY SFSCI_MSGTEXT_NOTIFYA #define SFSCI_MSGTEXT_INSTRUCTION SFSCI_MSGTEXT_INSTRUCTIONA #define SFSCI_MSGTEXT_CONFIRMATION SFSCI_MSGTEXT_CONFIRMATIONA #endif // TRUE/FALSE: if the above message text should be added to history. #define SFSCI_ADD_TO_HISTORY 5 // lParam = SFSCI_MSGTEXT_NOTIFY(A/W), SFSCI_MSGTEXT_INSTRUCTION(A/W) or SFSCI_MSGTEXT_CONFIRMATION(A/W) // Return Values: // -------------- // SFSCI_ACTIVATION_FILTER -> (BOOL)TRUE/FALSE // SFSCI_DELAY_TIME_REPLY -> (BOOL)TRUE/FALSE // SFSCI_MSGTEXT_NOTIFYA -> (char*) free with miranda_sys_free() of "m_system.h", (all %vars% in the text are already resolved) // SFSCI_MSGTEXT_INSTRUCTIONA -> see SFSCI_MSGTEXT_NOTIFYA // SFSCI_MSGTEXT_CONFIRMATIONA -> see SFSCI_MSGTEXT_NOTIFYA // SFSCI_MSGTEXT_NOTIFYW -> (WCHAR*) free with miranda_sys_free() of "m_system.h", (all %vars% in the text are already resolved) // SFSCI_MSGTEXT_INSTRUCTIONW -> see SFSCI_MSGTEXT_NOTIFYW // SFSCI_MSGTEXT_CONFIRMATIONW -> see SFSCI_MSGTEXT_NOTIFYW // SFSCI_ADD_TO_HISTORY -> (BOOL)TRUE/FALSE // returns NULL on error // ------------------------------------------- // -- Confirm spam check (Event) ------------- // ------------------------------------------- #define ME_SPAMFILTER_OKTOSPAMCHECK "SpamFilter/OkToSpamCheck" // Description: // ------------- // Gets fired before the spam check for a message starts. // Parameters: // ----------------- // wParam = (SPAMCHECKDATA*)scd (Pointer to SPAMCHECKDATA struct) // lParam = (UINT)uFilterType (For possible values see above) // Return Values: // ----------------- // Returning 0 on this event will accept spam checking for the message, // Returning 1 will prevent the spam check. // ------------------------------------------- // -- Confirm spam detection (Event) --------- // ------------------------------------------- #define ME_SPAMFILTER_OKTOSPAMDETECTION "SpamFilter/OkToSpamDetection" // Description: // ------------- // Gets fired after a spam message is detected. // Parameters: // ----------------- // wParam = (SPAMCHECKDATA*)scd (Pointer to SPAMCHECKDATA struct) // lParam = (UINT)uFilterType (For possible values see above) // Return Values: // ----------------- // Returning 0 on this event will accept the detection // Returning 1 cause the message not to be seen as spam. // Note: If you only would like to get the final result hook // ME_SPAMFILTER_SPAMRECEIVED instead // ------------------------------------------- // -- Spam message received (Event) ---------- // ------------------------------------------- #define ME_SPAMFILTER_SPAMRECEIVED "SpamFilter/SpamReceived" // Description: // ------------- // Gets fired when a message is recognized as spam. // Parameters: // ----------------- // wParam = (SPAMCHECKDATA*)scd (Pointer to SPAMCHECKDATA struct) // lParam = (UINT)uFilterType (For possible values see above) // Return Values: // ----------------- // The return value should be 0. // ------------------------------------------- // -- Spam Filter loaded --------------------- // ------------------------------------------- #define ME_SPAMFILTER_MODULELOADED "SpamFilter/ModuleLoaded" // Description: // ------------- // Gets fired when a all parts of the "Spam Filter" were loaded and available // to other plugins. // Past this event all functionality of the plugin is fully available. // // The event works quite similar as ME_SYSTEM_MODULESLOADED. // You should use ME_SYSTEM_MODULESLOADED in most cases instead. Please do so! // // (Service added in v2.0.1.0) // Parameters: // ----------------- // wParam = 0 // lParam = 0 // Return Values: // ----------------- // The return value should be 0. // ------------------------------------------- // -- Helper: Duplicate SPAMCHECKDATA -------- // ------------------------------------------- #define MS_SPAMFILTER_COPYSPAMCHECKDATA "SpamFilter/SpamCheckData/Copy" // Description: // ------------- // Copys all contents of a SPAMCHECKDATA struct (especially strings) to another one // using Miranda's Memory Manager Interface (see m_system.h). // Use MS_SPAMFILTER_FREESPAMCHECKDATA to free the result when no longer needed. // Available since 2.5.2.0. // An entire copy of the SPAMCHECKDATA structure is made at pscd->cbSize. // All strings are duplicated. // The pscdTo->cbSize member is set to the current size of SPAMCHECKDATA // that SpamFilter uses. // Warning: // If you pass a structure that is bigger than the current sizeof(SPAMCHECKDATA) // then do not use pointers not contained in the current area because // they will not be duplicated (However, you could duplicate them by yourself). // Parameters: // ------------- // wParam = (SPAMCHECKDATA*)pscdTo // lParam = (SPAMCHECKDATA*)pscdFrom // Return Values: // -------------- // Returns 0 on success, nonzero on error. // ------------------------------------------- // -- Helper: Free SPAMCHECKDATA ------------- // ------------------------------------------- #define MS_SPAMFILTER_FREESPAMCHECKDATA "SpamFilter/SpamCheckData/Free" // Description: // ------------- // Frees the memory allocated by MS_SPAMFILTER_COPYSPAMCHECKDATA. // using Miranda's Memory Manager Interface (see m_system.h). // Available since 2.5.2.0. // Parameters: // ------------- // wParam = (SPAMCHECKDATA*)pscd // lParam = 0 // Return Values: // -------------- // Returns 0 on success, nonzero on failure. // ------------------------------------------- // -- Showing error messages ----------------- // ------------------------------------------- #define MS_SPAMFILTER_SHOWERROR "SpamFilter/ShowError" // Description: // ------------- // Shows a Miranda try balloon tip, popup or message box // with the specified error message. // Parameters: // ------------- // wParam = (UINT)uErrorType (For possible values see below) // lParam = 0 // Possible values for wParam: #define SFSE_CRITICAL_ERROR 1 // Unspecified critical error occured related to the spam check. // Only use this for situations that may never ever occur. // Please do avoid this if possible. #define SFSE_SEND_FAILED 2 // Show this error when a sending of SFSCI_MSGTEXT_NOTIFY, // SFSCI_MSGTEXT_INSTRUCTION, SFSCI_MSGTEXT_CONFIRMATION or // SFSCI_MSGTEXT_NOTIFY failed (SFSCI_MSGTEXT_*) // Return Values: // -------------- // Returns 0 on success, nonzero on error. // ------------------------------------------- // -- Set contact as spammer (Contact) ------- // ------------------------------------------- #define MS_SPAMFILTER_CONTACT_SETASSPAMMER "SpamFilter/Contact/SetAsSpammer" // Description: // ------------- // This service adds a specified user to the spammer list (fully ignored). // Associated event: ME_SPAMFILTER_CONTACT_SPAMMERSTATECHANGED // Note: works same as MS_SPAMFILTER_CONTACT_SHOWSETASSPAMMERDIALOG // but does not prompt the user. // Available since v2.5.0.0 // Parameters: // ------------- // wParam = (HANDLE)hContact (Handle to a contact in database. Can't be NULL.) // lParam = (DWORD)dwFlags (flags about what should be done, see below) // Available Flags: #define SCASF_NO_NOTIFY 0x00000001 // Prevents logging and playing of sounds #define SCASF_USE_ROBOT_SOUND 0x00000002 // play robot sound instead of advertisment sound (only if SCASF_NO_NOTIFY is not set) #define SCASF_NO_REMOVE_HISTORY 0x00000004 // history is marked read instead of fully removed #define SCASF_NO_DENY_AUTHREQUESTS 0x00000008 // do not deny pending auth requests // Return Values: // -------------- // Returns 0 on success, nonzero on error. // ------------------------------------------- // -- Show mark spammer dialog (Contact) ----- // ------------------------------------------- #define MS_SPAMFILTER_CONTACT_SHOWSETASSPAMMERDIALOG "SpamFilter/Contact/ShowSetAsSpammerDlg" // Description: // ------------- // This service adds a specified user to the spammer list. // Before it shows a dialog to let the user confirm the action. // For use for example as action for a button on the message dialog. // Note: This service performs the same tasks as MS_SPAMFILTER_SETCONTACTASSPAMMER // to execute the action the user chooses. // Associated event: ME_SPAMFILTER_CONTACT_SPAMMERSTATECHANGED // Available since v2.5.0.0 // Parameters: // ------------- // wParam = (HANDLE)hContact (Handle to a contact in database. Can't be NULL.) // lParam = (HWND)hwndParent (Handle to the parent window. Can be NULL.) // Return Values: // -------------- // Returns FALSE if user clicked cancel on the dialog. // TRUE if the contact was handled as spammer. // Deprecated in v2.5.0.0: // The service MS_SPAMFILTER_SETSPAMMANUALLY has been deprecated. // New plugins should use MS_SPAMFILTER_CONTACT_SETASSPAMMERDLG instead. #define MS_SPAMFILTER_SETSPAMMANUALLY "SpamFilter/SetSpamManually" // Return Values: // -------------- // Returns 0 on success, nozero otherwise. // ------------------------------------------- // -- Test if contact is spammer (Contact) --- // ------------------------------------------- #define MS_SPAMFILTER_CONTACT_ISSPAMMER "SpamFilter/Contact/IsSpammer" // Description: // ------------- // This service tests if a specified contact is on the spammer list (fully ignored). // Available since v2.5.0.0 // Parameters: // ------------- // wParam = (HANDLE)hContact (Handle to a contact in database. Can't be NULL.) // lParam = 0 // Return Values: // -------------- // Returns TRUE when the contact is on the spammer list, FALSE otherwise. // ------------------------------------------- // -- Unmarks a contact as spammer (Contact) - // ------------------------------------------- #define MS_SPAMFILTER_CONTACT_UNSETSPAMMER "SpamFilter/Contact/UnSetSpammer" // Description: // ------------- // This service restores a spammer to be again a normal contact (unignored). // Associated event: ME_SPAMFILTER_CONTACT_SPAMMERSTATECHANGED // Available since v2.5.0.0 // Parameters: // ------------- // wParam = (HANDLE)hContact (Handle to a contact in database. Can't be NULL.) // lParam = 0 // Return Values: // -------------- // Returns 0 on success, nonzero on error. // ------------------------------------------- // -- Spammer state changed (Event) ---------- // ------------------------------------------- #define ME_SPAMFILTER_CONTACT_SPAMMERSTATECHANGED "SpamFilter/Contact/SpammerStateChanged" // Description: // ------------- // Gets fired when a a contact gets marked as spammer or unmarked. // Parameters: // ----------------- // wParam = (HANDLE)hContact // lParam = (BOOL)bIsSpammer (new state) // Return Values: // ----------------- // The return value should be 0. #endif // M_SPAMFILTER_H