diff options
| author | George Hazan <george.hazan@gmail.com> | 2014-02-10 08:04:30 +0000 | 
|---|---|---|
| committer | George Hazan <george.hazan@gmail.com> | 2014-02-10 08:04:30 +0000 | 
| commit | ddba4ede6b451d0cfcd0d32b5180fbd0689966bf (patch) | |
| tree | 5d74f37a7013d13b92c182628d6b68a58e148ae4 /plugins/StopSpamMod/src | |
| parent | c39340bf493a1745a41317bbf937fc7eb6cbb26a (diff) | |
- HANDLE hContact => HCONTACT
- GCF_* prefix was added to chat constants to avoid name conflicts
git-svn-id: http://svn.miranda-ng.org/main/trunk@8078 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/StopSpamMod/src')
| -rwxr-xr-x | plugins/StopSpamMod/src/init.cpp | 2 | ||||
| -rwxr-xr-x | plugins/StopSpamMod/src/stopspam.cpp | 8 | ||||
| -rwxr-xr-x | plugins/StopSpamMod/src/utilities.cpp | 30 | ||||
| -rwxr-xr-x | plugins/StopSpamMod/src/utilities.h | 12 | 
4 files changed, 26 insertions, 26 deletions
diff --git a/plugins/StopSpamMod/src/init.cpp b/plugins/StopSpamMod/src/init.cpp index 14c842d1df..5afac93be1 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(HANDLE hContact, char const * szModule, char const * szSetting, tstring errorValue);
 +extern tstring DBGetContactSettingStringPAN(HCONTACT 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 cd8fd9b75e..b2b788c30d 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)  { -	HANDLE hContact = (HANDLE)wParam; +	HCONTACT hContact = (HCONTACT)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) { -			HANDLE hcntct = DbGetAuthEventContact(&dbei); +			HCONTACT 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)  { -	HANDLE hContact = (HANDLE)w; +	HCONTACT hContact = (HCONTACT)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)  { -	HANDLE hContact = (HANDLE)w; +	HCONTACT hContact = (HCONTACT)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 73ab682878..ac092f927d 100755 --- a/plugins/StopSpamMod/src/utilities.cpp +++ b/plugins/StopSpamMod/src/utilities.cpp @@ -18,7 +18,7 @@  #include "headers.h"
 -tstring DBGetContactSettingStringPAN(HANDLE hContact, char const * szModule, char const * szSetting, tstring errorValue)
 +tstring DBGetContactSettingStringPAN(HCONTACT hContact, char const * szModule, char const * szSetting, tstring errorValue)
  {
  	DBVARIANT dbv;
  	//if(db_get(hContact, szModule, szSetting, &dbv))
 @@ -30,7 +30,7 @@ tstring DBGetContactSettingStringPAN(HANDLE hContact, char const * szModule, cha  	return errorValue;
  }
 -std::string DBGetContactSettingStringPAN_A(HANDLE hContact, char const * szModule, char const * szSetting, std::string errorValue)
 +std::string DBGetContactSettingStringPAN_A(HCONTACT 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, HANDLE hContact){
 +tstring variables_parse(tstring const &tstrFormat, HCONTACT hContact){
  	if (gbVarsServiceExist) {
  		FORMATINFO fi;
  		TCHAR *tszParsed;
 @@ -201,7 +201,7 @@ BOOL IsUrlContains(TCHAR * Str)  	return 0;
  }
 -tstring GetContactUid(HANDLE hContact, tstring Protocol)
 +tstring GetContactUid(HCONTACT hContact, tstring Protocol)
  {
  	tstring Uid;
  	TCHAR dUid[32]={0};
 @@ -235,7 +235,7 @@ tstring GetContactUid(HANDLE hContact, tstring Protocol)  	return Uid;
  }
 -void LogSpamToFile(HANDLE hContact, tstring message)
 +void LogSpamToFile(HCONTACT 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<HANDLE> contacts;
 -	for(HANDLE hContact = db_find_first(proto.c_str()); hContact; hContact = db_find_next(hContact, proto.c_str()))
 +	std::list<HCONTACT> contacts;
 +	for(HCONTACT 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<HANDLE>::iterator end = contacts.end();
 -	for(std::list<HANDLE>::iterator i = contacts.begin(); i != end; ++i)
 +	std::list<HCONTACT>::iterator end = contacts.end();
 +	for(std::list<HCONTACT>::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<HANDLE> contacts;
 -	for(HANDLE hContact = db_find_first(proto.c_str()); hContact; hContact = db_find_next(hContact, proto.c_str()))
 +	std::list<HCONTACT> contacts;
 +	for(HCONTACT 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<HANDLE>::iterator end = contacts.end();
 -	for(std::list<HANDLE>::iterator i = contacts.begin(); i != end; ++i)
 +	std::list<HCONTACT>::iterator end = contacts.end();
 +	for(std::list<HCONTACT>::iterator i = contacts.begin(); i != end; ++i)
  	{
  		LogSpamToFile(*i, _T("Deleted"));
  		HistoryLogFunc(*i, "Deleted");
 @@ -358,7 +358,7 @@ void CleanThread()  	}
  }
 -void HistoryLog(HANDLE hContact, char *data, int event_type, int flags)
 +void HistoryLog(HCONTACT hContact, char *data, int event_type, int flags)
  {
  	DBEVENTINFO Event = { sizeof(Event) };
  	Event.szModule = pluginName;
 @@ -370,7 +370,7 @@ void HistoryLog(HANDLE hContact, char *data, int event_type, int flags)  	db_event_add(hContact, &Event);
  }
 -void HistoryLogFunc(HANDLE hContact, std::string message)
 +void HistoryLogFunc(HCONTACT hContact, std::string message)
  {
  	if(gbHistoryLog)
  	{
 diff --git a/plugins/StopSpamMod/src/utilities.h b/plugins/StopSpamMod/src/utilities.h index 62a3ef5750..287a7bc54e 100755 --- a/plugins/StopSpamMod/src/utilities.h +++ b/plugins/StopSpamMod/src/utilities.h @@ -1,19 +1,19 @@ -tstring DBGetContactSettingStringPAN(HANDLE hContact, char const * szModule, char const * szSetting, tstring errorValue); -std::string DBGetContactSettingStringPAN_A(HANDLE hContact, char const * szModule, char const * szSetting, std::string errorValue); +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 &GetDlgItemString(HWND hwnd, int id);  std::string &GetProtoList();  bool ProtoInList(std::string proto);  void RemoveExcludedUsers(); -tstring variables_parse(tstring const &tstrFormat, HANDLE hContact); +tstring variables_parse(tstring const &tstrFormat, HCONTACT 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(HANDLE hContact, std::string Protocol); -void LogSpamToFile(HANDLE hContact, tstring message); +tstring GetContactUid(HCONTACT hContact, std::string Protocol); +void LogSpamToFile(HCONTACT hContact, tstring message);  std::string toUTF8(std::wstring str);  std::string toUTF8(std::string str);  std::wstring toUTF16(std::string str); -void HistoryLogFunc(HANDLE hContact, std::string message); +void HistoryLogFunc(HCONTACT hContact, std::string message);  std::string get_random_num(int length);
\ No newline at end of file  | 
