summaryrefslogtreecommitdiff
path: root/plugins/Spamotron
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-02-10 20:47:51 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-02-10 20:47:51 +0000
commit68d3fd47bb9b75e65859d14199ffee01f16ac9a7 (patch)
treefcc340ad7067561e57733b287f193a7dbed93dd4 /plugins/Spamotron
parent7193759b046338c6f47ff2edb34743a1465791cd (diff)
HCONTACT is not needed anymore
git-svn-id: http://svn.miranda-ng.org/main/trunk@8086 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Spamotron')
-rw-r--r--plugins/Spamotron/src/bayes.cpp8
-rw-r--r--plugins/Spamotron/src/common.h12
-rw-r--r--plugins/Spamotron/src/options.cpp2
-rw-r--r--plugins/Spamotron/src/popups.cpp2
-rw-r--r--plugins/Spamotron/src/spamotron.cpp6
-rw-r--r--plugins/Spamotron/src/utils.cpp4
6 files changed, 17 insertions, 17 deletions
diff --git a/plugins/Spamotron/src/bayes.cpp b/plugins/Spamotron/src/bayes.cpp
index 9df33ba9a1..d444e12411 100644
--- a/plugins/Spamotron/src/bayes.cpp
+++ b/plugins/Spamotron/src/bayes.cpp
@@ -221,7 +221,7 @@ double get_msg_score(TCHAR *msg)
return tmp1 / (tmp1 + tmp2);
}
-void queue_message(HCONTACT hContact, DWORD msgtime, TCHAR *message)
+void queue_message(MCONTACT hContact, DWORD msgtime, TCHAR *message)
{
char *tmp;
sqlite3_stmt *stmt;
@@ -245,7 +245,7 @@ void queue_message(HCONTACT hContact, DWORD msgtime, TCHAR *message)
sqlite3_finalize(stmt);
}
-void bayes_approve_contact(HCONTACT hContact)
+void bayes_approve_contact(MCONTACT hContact)
{
const char *message;
TCHAR *messageW;
@@ -353,7 +353,7 @@ void learn(int type, TCHAR *msg)
#ifdef _DEBUG
sqlite3_prepare_v2(bayesdbg, sql_select, -1, &stmtdbg, NULL);
- sqlite3_bind_text(stmtdbg, 1, tok, strlen(tok), NULL);
+ sqlite3_bind_text(stmtdbg, 1, tok, (int)strlen(tok), NULL);
if (SQLITE_ROW == sqlite3_step(stmtdbg)) {
sqlite3_finalize(stmtdbg);
sqlite3_prepare_v2(bayesdbg, sql_update, -1, &stmtdbg, NULL);
@@ -361,7 +361,7 @@ void learn(int type, TCHAR *msg)
sqlite3_finalize(stmtdbg);
sqlite3_prepare_v2(bayesdbg, sql_insert, -1, &stmtdbg, NULL);
}
- sqlite3_bind_text(stmtdbg, 1, tok, strlen(tok), SQLITE_STATIC);
+ sqlite3_bind_text(stmtdbg, 1, tok, (int)strlen(tok), SQLITE_STATIC);
sqlite3_step(stmtdbg);
sqlite3_finalize(stmtdbg);
#endif
diff --git a/plugins/Spamotron/src/common.h b/plugins/Spamotron/src/common.h
index 2e9501c0ff..1de7db832c 100644
--- a/plugins/Spamotron/src/common.h
+++ b/plugins/Spamotron/src/common.h
@@ -42,7 +42,7 @@
#define _getOptD(a,b) _getCOptD(NULL, a, b)
#define _setOptD(a,b) _setCOptD(NULL, a, b)
-TCHAR* _getCOptS(TCHAR *buf, unsigned int buflen, HCONTACT hContact, const char* option, const TCHAR *def);
+TCHAR* _getCOptS(TCHAR *buf, unsigned int buflen, MCONTACT hContact, const char* option, const TCHAR *def);
#define _getOptS(a,b,c,d) _getCOptS(a, b, NULL, c, d)
#define _setCOptTS(a,b,c) db_set_ts(a, PLUGIN_NAME, b, c)
#define _setCOptS(a,b,c) db_set_s(a, PLUGIN_NAME, b, c)
@@ -105,11 +105,11 @@ BOOL _isvalidregex(TCHAR* strSearch);
BOOL _regmatch(TCHAR* str, TCHAR* strSearch);
BOOL Contains(TCHAR* dst, TCHAR* src);
BOOL isOneDay(DWORD timestamp1, DWORD timestamp2);
-void MarkUnread(HCONTACT hContact);
+void MarkUnread(MCONTACT hContact);
-int ShowPopup(HCONTACT hContact, BYTE popupType, TCHAR *line1, TCHAR *line2);
+int ShowPopup(MCONTACT hContact, BYTE popupType, TCHAR *line1, TCHAR *line2);
int ShowPopupPreview(HWND optDlg, BYTE popupType, TCHAR *line1, TCHAR *line2);
-int _notify(HCONTACT hContact, BYTE type, TCHAR *message, TCHAR *origmessage);
+int _notify(MCONTACT hContact, BYTE type, TCHAR *message, TCHAR *origmessage);
int LogToSystemHistory(char *message, char *origmessage);
#define POPUP_DEFAULT 0
#define POPUP_BLOCKED 1
@@ -151,8 +151,8 @@ void learn_spam(TCHAR *msg);
int get_token_count(int type);
int get_msg_count(int type);
double get_msg_score(TCHAR *msg);
-void queue_message(HCONTACT hContact, DWORD msgtime, TCHAR *message);
-void bayes_approve_contact(HCONTACT hContact);
+void queue_message(MCONTACT hContact, DWORD msgtime, TCHAR *message);
+void bayes_approve_contact(MCONTACT hContact);
void dequeue_messages();
#ifdef _DEBUG
diff --git a/plugins/Spamotron/src/options.cpp b/plugins/Spamotron/src/options.cpp
index 7a3cdf0672..1aa1f6c119 100644
--- a/plugins/Spamotron/src/options.cpp
+++ b/plugins/Spamotron/src/options.cpp
@@ -2,7 +2,7 @@
TCHAR currentResponse[256] = {0};
-TCHAR* _getCOptS(TCHAR *buf, unsigned int buflen, HCONTACT hContact, const char* option, const TCHAR *def)
+TCHAR* _getCOptS(TCHAR *buf, unsigned int buflen, MCONTACT hContact, const char* option, const TCHAR *def)
{
DBVARIANT dbv = {0};
_tcsnset(buf, 0, buflen);
diff --git a/plugins/Spamotron/src/popups.cpp b/plugins/Spamotron/src/popups.cpp
index ee11962bed..415bcc3517 100644
--- a/plugins/Spamotron/src/popups.cpp
+++ b/plugins/Spamotron/src/popups.cpp
@@ -192,7 +192,7 @@ int ShowPopupPreview(HWND optDlg, BYTE popupType, TCHAR *line1, TCHAR *line2)
}
-int ShowPopup(HCONTACT hContact, BYTE popupType, TCHAR *line1, TCHAR *line2)
+int ShowPopup(MCONTACT hContact, BYTE popupType, TCHAR *line1, TCHAR *line2)
{
POPUPDATAT ppdp = {0};
switch (popupType)
diff --git a/plugins/Spamotron/src/spamotron.cpp b/plugins/Spamotron/src/spamotron.cpp
index 0c79c8b958..c3e32f01d6 100644
--- a/plugins/Spamotron/src/spamotron.cpp
+++ b/plugins/Spamotron/src/spamotron.cpp
@@ -50,7 +50,7 @@ int OnDBEventAdded(WPARAM wParam, LPARAM lParam)
int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam)
{
- HCONTACT hContact = (HCONTACT)wParam;
+ MCONTACT hContact = (MCONTACT)wParam;
DBEVENTINFO *dbei = (DBEVENTINFO *)lParam;
char *msgblob;
POPUPDATA ppdp = {0};
@@ -68,7 +68,7 @@ int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam)
// get hContact from DBEVENTINFO as icq_proto.c doesn't pass hContact the usual way for some reason.
if (dbei->eventType == EVENTTYPE_AUTHREQUEST)
- hContact = (HCONTACT)*(PDWORD(dbei->pBlob+sizeof(DWORD)));
+ hContact = (MCONTACT)*(PDWORD(dbei->pBlob+sizeof(DWORD)));
// get maximum length of the message a protocol supports
maxmsglen = CallProtoService(dbei->szModule, PS_GETCAPS, PFLAG_MAXLENOFMESSAGE, (LPARAM)hContact);
@@ -524,7 +524,7 @@ void RemoveNotOnListSettings()
{
DBVARIANT dbv;
char protoName[256] = {0};
- HCONTACT hContact = db_find_first();
+ MCONTACT hContact = db_find_first();
strcpy(protoName, "proto_");
while (hContact != NULL) {
if (db_get_s(hContact, "Protocol", "p", &dbv) == 0) {
diff --git a/plugins/Spamotron/src/utils.cpp b/plugins/Spamotron/src/utils.cpp
index 4858ee2297..5c561aa750 100644
--- a/plugins/Spamotron/src/utils.cpp
+++ b/plugins/Spamotron/src/utils.cpp
@@ -433,7 +433,7 @@ TCHAR* ReplaceVarsNum(TCHAR *dst, unsigned int len, int num)
return dst;
}
-int _notify(HCONTACT hContact, BYTE type, TCHAR *message, TCHAR *origmessage)
+int _notify(MCONTACT hContact, BYTE type, TCHAR *message, TCHAR *origmessage)
{
char *tmp, *tmporig;
TCHAR msg[MAX_BUFFER_LENGTH];
@@ -484,7 +484,7 @@ int LogToSystemHistory(char *message, char *origmessage)
return 0;
}
-void MarkUnread(HCONTACT hContact)
+void MarkUnread(MCONTACT hContact)
{
// We're not actually marking anything. We just pushing saved events to the database from a temporary location
DBVARIANT _dbv = {0};