diff options
author | George Hazan <george.hazan@gmail.com> | 2016-04-15 13:40:58 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-04-15 13:40:58 +0000 |
commit | 18f7e9261c885e953f220ba6836e8bca43a6fc88 (patch) | |
tree | 67cb94186914b97f1c0e8e815afffea7666b2510 /plugins/StopSpamMod/src | |
parent | d2dd1c6dddd3e690ad13d2b355de60d3724e8ec6 (diff) |
contact list groups:
- finally database is not used anymore (only as a settings' storage);
- MGROUP type introduced to replace HANDLE for group ids;
- MS_CLIST_GROUP* services became Clist_Group* functions;
- CLIST_INTERFACE members pfnGetGroupName & pfnRenameGroup also transformed into static Clist_Group* functions
git-svn-id: http://svn.miranda-ng.org/main/trunk@16659 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/StopSpamMod/src')
-rwxr-xr-x | plugins/StopSpamMod/src/options.cpp | 8 | ||||
-rwxr-xr-x | plugins/StopSpamMod/src/utilities.cpp | 14 |
2 files changed, 6 insertions, 16 deletions
diff --git a/plugins/StopSpamMod/src/options.cpp b/plugins/StopSpamMod/src/options.cpp index c4c32f55dc..5878c9ce40 100755 --- a/plugins/StopSpamMod/src/options.cpp +++ b/plugins/StopSpamMod/src/options.cpp @@ -17,8 +17,6 @@ #include "stdafx.h"
-int CreateCListGroup(TCHAR* szGroupName);
-
char *pluginDescription = LPGEN("No more spam! Robots can't go! Only human beings invited!\r\n\r\nThis plugin works pretty simple:\r\nWhile messages from users on your contact list go as there is no any anti-spam software, messages from unknown users are not delivered to you. But also they are not ignored, this plugin replies with a simple question, and if user gives the right answer, plugin adds him to your contact list so that he can contact you.");
TCHAR const *defQuestion = TranslateT("Spammers made me to install small anti-spam system you are now speaking with.\r\nPlease reply \"nospam\" without quotes and spaces if you want to contact me.");
@@ -280,7 +278,7 @@ INT_PTR CALLBACK AdvancedDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar db_set_ws(NULL, pluginName, "SpammersGroup", NewGroupName.c_str());
gbSpammersGroup = DBGetContactSettingStringPAN(NULL, pluginName, "SpammersGroup", _T("Spammers"));
if (!GroupExist && gbSpecialGroup)
- CreateCListGroup((TCHAR*)gbSpammersGroup.c_str());
+ Clist_GroupCreate(0, gbSpammersGroup.c_str());
}
}
db_set_b(NULL, pluginName, "SpecialGroup", gbSpecialGroup = BST_CHECKED == IsDlgButtonChecked(hwnd, ID_SPECIALGROUP));
@@ -304,7 +302,7 @@ INT_PTR CALLBACK AdvancedDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar db_set_ws(NULL, pluginName, "AutoAuthGroup", NewAGroupName.c_str());
gbAutoAuthGroup = DBGetContactSettingStringPAN(NULL, pluginName, "AutoAuthGroup", _T("Not Spammers"));
if (!GroupExist && gbAutoAddToServerList)
- CreateCListGroup((TCHAR*)gbAutoAuthGroup.c_str());
+ Clist_GroupCreate(0, gbAutoAuthGroup.c_str());
}
}
return TRUE;
@@ -317,6 +315,8 @@ INT_PTR CALLBACK AdvancedDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar HINSTANCE hInst;
MIRANDA_HOOK_EVENT(ME_OPT_INITIALISE, w, l)
{
+ UNREFERENCED_PARAMETER(l);
+
OPTIONSDIALOGPAGE odp = { 0 };
odp.ptszGroup = LPGENT("Message sessions");
odp.ptszTitle = LPGENT("StopSpam");
diff --git a/plugins/StopSpamMod/src/utilities.cpp b/plugins/StopSpamMod/src/utilities.cpp index 2cad3a82a6..cc13f07cbd 100755 --- a/plugins/StopSpamMod/src/utilities.cpp +++ b/plugins/StopSpamMod/src/utilities.cpp @@ -64,16 +64,6 @@ bool ProtoInList(std::string proto) return std::string::npos != GetProtoList().find(proto + "\r\n");
}
-int CreateCListGroup(TCHAR* szGroupName)
-{
- int hGroup = CallService(MS_CLIST_GROUPCREATE, 0, 0);
-
- TCHAR* usTmp = szGroupName;
- pcli->pfnRenameGroup(hGroup, usTmp);
-
- return hGroup;
-}
-
void DeleteCListGroupsByName(TCHAR* szGroupName)
{
BYTE ConfirmDelete = db_get_b(NULL, "CList", "ConfirmDelete", SETTING_CONFIRMDELETE_DEFAULT);
@@ -81,9 +71,9 @@ void DeleteCListGroupsByName(TCHAR* szGroupName) db_set_b(NULL, "CList", "ConfirmDelete", 0);
TCHAR *szGroup;
- for (int i = 1; (szGroup = pcli->pfnGetGroupName(i, NULL)) != NULL; i++)
+ for (int i = 1; (szGroup = Clist_GroupGetName(i, NULL)) != NULL; i++)
if (!mir_wstrcmp(szGroupName, szGroup))
- CallService(MS_CLIST_GROUPDELETE, i, 0);
+ Clist_GroupDelete(i);
if (ConfirmDelete)
db_set_b(NULL, "CList", "ConfirmDelete", ConfirmDelete);
|