summaryrefslogtreecommitdiff
path: root/plugins/StopSpamMod/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/StopSpamMod/src')
-rwxr-xr-xplugins/StopSpamMod/src/init.cpp2
-rwxr-xr-xplugins/StopSpamMod/src/stopspam.cpp8
-rwxr-xr-xplugins/StopSpamMod/src/utilities.cpp32
-rwxr-xr-xplugins/StopSpamMod/src/utilities.h12
4 files changed, 27 insertions, 27 deletions
diff --git a/plugins/StopSpamMod/src/init.cpp b/plugins/StopSpamMod/src/init.cpp
index 5afac93be1..727d83a33a 100755
--- a/plugins/StopSpamMod/src/init.cpp
+++ b/plugins/StopSpamMod/src/init.cpp
@@ -76,7 +76,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
return &pluginInfoEx;
}
-extern tstring DBGetContactSettingStringPAN(HCONTACT hContact, char const * szModule, char const * szSetting, tstring errorValue);
+extern tstring DBGetContactSettingStringPAN(MCONTACT hContact, char const * szModule, char const * szSetting, tstring errorValue);
void InitVars()
{
diff --git a/plugins/StopSpamMod/src/stopspam.cpp b/plugins/StopSpamMod/src/stopspam.cpp
index b2b788c30d..7890bf6ab7 100755
--- a/plugins/StopSpamMod/src/stopspam.cpp
+++ b/plugins/StopSpamMod/src/stopspam.cpp
@@ -26,7 +26,7 @@ MIRANDA_HOOK_EVENT(ME_DB_CONTACT_ADDED, w, l)
MIRANDA_HOOK_EVENT(ME_DB_EVENT_ADDED, wParam, lParam)
{
- HCONTACT hContact = (HCONTACT)wParam;
+ MCONTACT hContact = (MCONTACT)wParam;
HANDLE hDbEvent = (HANDLE)lParam;
DBEVENTINFO dbei = { sizeof(dbei) };
@@ -44,7 +44,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_ADDED, wParam, lParam)
// event is an auth request
if(gbHandleAuthReq) {
if(!(dbei.flags & DBEF_SENT) && !(dbei.flags & DBEF_READ) && dbei.eventType == EVENTTYPE_AUTHREQUEST) {
- HCONTACT hcntct = DbGetAuthEventContact(&dbei);
+ MCONTACT hcntct = DbGetAuthEventContact(&dbei);
// if request is from unknown or not marked Answered contact
int a = db_get_b(hcntct, "CList", "NotOnList", 0);
@@ -83,7 +83,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_ADDED, wParam, lParam)
MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l)
{
- HCONTACT hContact = (HCONTACT)w;
+ MCONTACT hContact = (MCONTACT)w;
if(!l) //fix potential DEP crash
return 0;
DBEVENTINFO * dbei = (DBEVENTINFO*)l;
@@ -345,7 +345,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l)
MIRANDA_HOOK_EVENT(ME_DB_CONTACT_SETTINGCHANGED, w, l)
{
- HCONTACT hContact = (HCONTACT)w;
+ MCONTACT hContact = (MCONTACT)w;
DBCONTACTWRITESETTING * cws = (DBCONTACTWRITESETTING*)l;
// if CList/NotOnList is being deleted then remove answeredSetting
diff --git a/plugins/StopSpamMod/src/utilities.cpp b/plugins/StopSpamMod/src/utilities.cpp
index e4a7793514..db12bee1a7 100755
--- a/plugins/StopSpamMod/src/utilities.cpp
+++ b/plugins/StopSpamMod/src/utilities.cpp
@@ -18,7 +18,7 @@
#include "headers.h"
-tstring DBGetContactSettingStringPAN(HCONTACT hContact, char const * szModule, char const * szSetting, tstring errorValue)
+tstring DBGetContactSettingStringPAN(MCONTACT hContact, char const * szModule, char const * szSetting, tstring errorValue)
{
DBVARIANT dbv;
//if(db_get(hContact, szModule, szSetting, &dbv))
@@ -30,7 +30,7 @@ tstring DBGetContactSettingStringPAN(HCONTACT hContact, char const * szModule, c
return errorValue;
}
-std::string DBGetContactSettingStringPAN_A(HCONTACT hContact, char const * szModule, char const * szSetting, std::string errorValue)
+std::string DBGetContactSettingStringPAN_A(MCONTACT hContact, char const * szModule, char const * szSetting, std::string errorValue)
{
DBVARIANT dbv;
//if(db_get(hContact, szModule, szSetting, &dbv))
@@ -97,7 +97,7 @@ int RemoveTmp(WPARAM,LPARAM)
return 0;
}
-tstring variables_parse(tstring const &tstrFormat, HCONTACT hContact){
+tstring variables_parse(tstring const &tstrFormat, MCONTACT hContact){
if (gbVarsServiceExist) {
FORMATINFO fi;
TCHAR *tszParsed;
@@ -201,7 +201,7 @@ BOOL IsUrlContains(TCHAR * Str)
return 0;
}
-tstring GetContactUid(HCONTACT hContact, tstring Protocol)
+tstring GetContactUid(MCONTACT hContact, tstring Protocol)
{
tstring Uid;
TCHAR dUid[32]={0};
@@ -235,7 +235,7 @@ tstring GetContactUid(HCONTACT hContact, tstring Protocol)
return Uid;
}
-void LogSpamToFile(HCONTACT hContact, tstring message)
+void LogSpamToFile(MCONTACT hContact, tstring message)
{
if (!gbLogToFile) return;
@@ -293,15 +293,15 @@ void CleanProtocolTmpThread(std::string proto)
boost::this_thread::sleep(boost::posix_time::seconds(2));
}
- std::list<HCONTACT> contacts;
- for(HCONTACT hContact = db_find_first(proto.c_str()); hContact; hContact = db_find_next(hContact, proto.c_str()))
+ std::list<MCONTACT> contacts;
+ for(MCONTACT hContact = db_find_first(proto.c_str()); hContact; hContact = db_find_next(hContact, proto.c_str()))
if(db_get_b(hContact, "CList", "NotOnList", 0)|| (_T("Not In List")== DBGetContactSettingStringPAN(hContact,"CList","Group",_T(""))))
contacts.push_back(hContact);
boost::this_thread::sleep(boost::posix_time::seconds(5));
clean_mutex.lock();
- std::list<HCONTACT>::iterator end = contacts.end();
- for(std::list<HCONTACT>::iterator i = contacts.begin(); i != end; ++i)
+ std::list<MCONTACT>::iterator end = contacts.end();
+ for(std::list<MCONTACT>::iterator i = contacts.begin(); i != end; ++i)
{
LogSpamToFile(*i, _T("Deleted"));
HistoryLogFunc(*i, "Deleted");
@@ -320,15 +320,15 @@ void CleanProtocolExclThread(std::string proto)
boost::this_thread::sleep(boost::posix_time::seconds(2));
}
- std::list<HCONTACT> contacts;
- for(HCONTACT hContact = db_find_first(proto.c_str()); hContact; hContact = db_find_next(hContact, proto.c_str()))
+ std::list<MCONTACT> contacts;
+ for(MCONTACT hContact = db_find_first(proto.c_str()); hContact; hContact = db_find_next(hContact, proto.c_str()))
if(db_get_b(hContact, "CList", "NotOnList", 0) && db_get_b(hContact, pluginName, "Excluded", 0))
contacts.push_back(hContact);
boost::this_thread::sleep(boost::posix_time::seconds(5));
clean_mutex.lock();
- std::list<HCONTACT>::iterator end = contacts.end();
- for(std::list<HCONTACT>::iterator i = contacts.begin(); i != end; ++i)
+ std::list<MCONTACT>::iterator end = contacts.end();
+ for(std::list<MCONTACT>::iterator i = contacts.begin(); i != end; ++i)
{
LogSpamToFile(*i, _T("Deleted"));
HistoryLogFunc(*i, "Deleted");
@@ -358,7 +358,7 @@ void CleanThread()
}
}
-void HistoryLog(HCONTACT hContact, char *data, int event_type, int flags)
+void HistoryLog(MCONTACT hContact, char *data, int event_type, int flags)
{
DBEVENTINFO Event = { sizeof(Event) };
Event.szModule = pluginName;
@@ -370,11 +370,11 @@ void HistoryLog(HCONTACT hContact, char *data, int event_type, int flags)
db_event_add(hContact, &Event);
}
-void HistoryLogFunc(HCONTACT hContact, std::string message)
+void HistoryLogFunc(MCONTACT hContact, std::string message)
{
if(gbHistoryLog)
{
- if(hContact == (HCONTACT)INVALID_HANDLE_VALUE)
+ if(hContact == INVALID_CONTACT_ID)
return;
std::string msg = message;
diff --git a/plugins/StopSpamMod/src/utilities.h b/plugins/StopSpamMod/src/utilities.h
index 287a7bc54e..4120d0dec9 100755
--- a/plugins/StopSpamMod/src/utilities.h
+++ b/plugins/StopSpamMod/src/utilities.h
@@ -1,19 +1,19 @@
-tstring DBGetContactSettingStringPAN(HCONTACT hContact, char const * szModule, char const * szSetting, tstring errorValue);
-std::string DBGetContactSettingStringPAN_A(HCONTACT hContact, char const * szModule, char const * szSetting, std::string errorValue);
+tstring DBGetContactSettingStringPAN(MCONTACT hContact, char const * szModule, char const * szSetting, tstring errorValue);
+std::string DBGetContactSettingStringPAN_A(MCONTACT hContact, char const * szModule, char const * szSetting, std::string errorValue);
tstring &GetDlgItemString(HWND hwnd, int id);
std::string &GetProtoList();
bool ProtoInList(std::string proto);
void RemoveExcludedUsers();
-tstring variables_parse(tstring const &tstrFormat, HCONTACT hContact);
+tstring variables_parse(tstring const &tstrFormat, MCONTACT hContact);
const int Stricmp(const TCHAR *str, const TCHAR *substr);
//const int Stristr(const TCHAR *str, const TCHAR *substr);
TCHAR* ReqGetText(DBEVENTINFO* dbei);
BOOL IsUrlContains(TCHAR * Str);
void DeleteCListGroupsByName(TCHAR* szGroupName);
-tstring GetContactUid(HCONTACT hContact, std::string Protocol);
-void LogSpamToFile(HCONTACT hContact, tstring message);
+tstring GetContactUid(MCONTACT hContact, std::string Protocol);
+void LogSpamToFile(MCONTACT hContact, tstring message);
std::string toUTF8(std::wstring str);
std::string toUTF8(std::string str);
std::wstring toUTF16(std::string str);
-void HistoryLogFunc(HCONTACT hContact, std::string message);
+void HistoryLogFunc(MCONTACT hContact, std::string message);
std::string get_random_num(int length); \ No newline at end of file