summaryrefslogtreecommitdiff
path: root/plugins/StopSpamPlus/src
diff options
context:
space:
mode:
authorVadim Dashevskiy <watcherhd@gmail.com>2012-07-24 09:26:39 +0000
committerVadim Dashevskiy <watcherhd@gmail.com>2012-07-24 09:26:39 +0000
commit1e92bf5cf72665b5fec103a0a70d734340725539 (patch)
tree7f9dc318b0e18b2cd55e2604c309eb006c11f278 /plugins/StopSpamPlus/src
parentcd441faefd073cfd368d815f4237d7b4996a1063 (diff)
StopSpamPlus, TipperYM, TooltipNotify, TopToolBar, TranslitSwitcher, UserGuide: changed folder structure
git-svn-id: http://svn.miranda-ng.org/main/trunk@1159 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/StopSpamPlus/src')
-rw-r--r--plugins/StopSpamPlus/src/events.cpp2
-rw-r--r--plugins/StopSpamPlus/src/headers.h71
-rw-r--r--plugins/StopSpamPlus/src/opt_proto.cpp2
-rw-r--r--plugins/StopSpamPlus/src/options.cpp2
-rw-r--r--plugins/StopSpamPlus/src/resource.h33
-rw-r--r--plugins/StopSpamPlus/src/services.cpp2
-rw-r--r--plugins/StopSpamPlus/src/settings.cpp2
-rw-r--r--plugins/StopSpamPlus/src/settings.h2
-rw-r--r--plugins/StopSpamPlus/src/stopspam.cpp2
-rw-r--r--plugins/StopSpamPlus/src/utils.cpp2
-rw-r--r--plugins/StopSpamPlus/src/version.h51
11 files changed, 163 insertions, 8 deletions
diff --git a/plugins/StopSpamPlus/src/events.cpp b/plugins/StopSpamPlus/src/events.cpp
index c4943f8e0f..41f4d9e8eb 100644
--- a/plugins/StopSpamPlus/src/events.cpp
+++ b/plugins/StopSpamPlus/src/events.cpp
@@ -1,4 +1,4 @@
-#include "../headers.h"
+#include "headers.h"
MIRANDA_HOOK_EVENT(ME_DB_EVENT_ADDED, wParam, lParam)
diff --git a/plugins/StopSpamPlus/src/headers.h b/plugins/StopSpamPlus/src/headers.h
new file mode 100644
index 0000000000..6da161f793
--- /dev/null
+++ b/plugins/StopSpamPlus/src/headers.h
@@ -0,0 +1,71 @@
+#ifndef _stopspam_headers_h
+#define _stopspam_headers_h
+
+// disable security warnings about "*_s" functions
+#define _CRT_SECURE_NO_DEPRECATE
+
+// disable warnings about underscore in stdc functions
+#pragma warning(disable: 4996)
+
+#define MIRANDA_VER 0x0A00
+
+#include <windows.h>
+#include <stdio.h>
+#include <commctrl.h>
+#include <time.h>
+#include <string>
+#include <sstream>
+
+#include <newpluginapi.h>
+#include <m_database.h>
+#include <m_protosvc.h>
+#include <m_options.h>
+#include <m_utils.h>
+#include <m_langpack.h>
+#include <m_icolib.h>
+#include <m_skin.h>
+#include <m_clist.h>
+
+#include "eventhooker.h"
+#include "version.h"
+#include "resource.h"
+#include "m_stopspam.h"
+
+#include "m_variables.h"
+
+#define pluginName "StopSpam"
+
+extern char * pluginDescription;
+extern TCHAR const * infTalkProtPrefix;
+extern char const * answeredSetting;
+extern char const * questCountSetting;
+extern HANDLE hLoadHook;
+extern HINSTANCE hInst;
+
+#ifdef _UNICODE
+ typedef std::wstring tstring;
+ #define PREF_TCHAR2 PREF_UTF
+#else
+ typedef std::string tstring;
+ #define PREF_TCHAR2 0
+#endif //_UNICODE
+
+#include "settings.h"
+
+//options
+INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
+INT_PTR CALLBACK MessagesDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
+INT_PTR CALLBACK ProtoDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
+
+//utils
+void SetDlgItemString(HWND hwndDlg, UINT idItem, std::string const &str);
+void SetDlgItemString(HWND hwndDlg, UINT idItem, std::wstring const &str);
+tstring &GetDlgItemString(HWND hwnd, int id);
+bool IsExistMyMessage(HANDLE hContact);
+tstring variables_parse(tstring const &tstrFormat, HANDLE hContact);
+tstring trim(tstring const &tstr, tstring const &trimChars = _T(" \f\n\r\t\v"));
+
+INT_PTR IsContactPassed(WPARAM wParam, LPARAM /*lParam*/);
+INT_PTR RemoveTempContacts(WPARAM wParam,LPARAM lParam);
+int OnSystemModulesLoaded(WPARAM wParam, LPARAM lParam);
+#endif
diff --git a/plugins/StopSpamPlus/src/opt_proto.cpp b/plugins/StopSpamPlus/src/opt_proto.cpp
index 014a44e7c7..cfdfe0b991 100644
--- a/plugins/StopSpamPlus/src/opt_proto.cpp
+++ b/plugins/StopSpamPlus/src/opt_proto.cpp
@@ -1,4 +1,4 @@
-#include "../headers.h"
+#include "headers.h"
struct ProtocolData
{
diff --git a/plugins/StopSpamPlus/src/options.cpp b/plugins/StopSpamPlus/src/options.cpp
index 52fab03e8f..221a06f480 100644
--- a/plugins/StopSpamPlus/src/options.cpp
+++ b/plugins/StopSpamPlus/src/options.cpp
@@ -1,4 +1,4 @@
-#include "../headers.h"
+#include "headers.h"
char * pluginDescription = "No more spam! Robots can't go! Only human beings invited!\r\n\r\n"
"This plugin works pretty simple:\r\n"
diff --git a/plugins/StopSpamPlus/src/resource.h b/plugins/StopSpamPlus/src/resource.h
new file mode 100644
index 0000000000..62e603cb2e
--- /dev/null
+++ b/plugins/StopSpamPlus/src/resource.h
@@ -0,0 +1,33 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by stopspam.rc
+//
+#define IDD_MESSAGES 101
+#define IDD_MAIN 102
+#define IDD_PROTO 103
+#define ID_DESCRIPTION 1001
+#define ID_QUESTION 1002
+#define ID_ANSWER 1003
+#define ID_CONGRATULATION 1004
+#define ID_RESTOREDEFAULTS 1005
+#define ID_AUTHREPL 1007
+#define ID_MAXQUESTCOUNT 1008
+#define IDC_PROTO 1009
+#define ID_INFTALKPROT 1010
+#define ID_ADDPERMANENT 1011
+#define ID_HANDLEAUTHREQ 1012
+#define ID_NOTCASESENS 1013
+#define ID_DIVIDER 1014
+#define IDC_VARS 1015
+#define ID_REMOVE_TMP_ALL 1016
+#define ID_HISTORY_LOG 1017
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 104
+#define _APS_NEXT_COMMAND_VALUE 40001
+#define _APS_NEXT_CONTROL_VALUE 1018
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
diff --git a/plugins/StopSpamPlus/src/services.cpp b/plugins/StopSpamPlus/src/services.cpp
index 1f9097446d..7fe08a9600 100644
--- a/plugins/StopSpamPlus/src/services.cpp
+++ b/plugins/StopSpamPlus/src/services.cpp
@@ -1,4 +1,4 @@
-#include "../headers.h"
+#include "headers.h"
INT_PTR IsContactPassed(WPARAM wParam, LPARAM /*lParam*/)
{
diff --git a/plugins/StopSpamPlus/src/settings.cpp b/plugins/StopSpamPlus/src/settings.cpp
index 7d74b63919..05a9007d0c 100644
--- a/plugins/StopSpamPlus/src/settings.cpp
+++ b/plugins/StopSpamPlus/src/settings.cpp
@@ -1,4 +1,4 @@
-#include "../headers.h"
+#include "headers.h"
//reading from database-------------
tstring db_usage::DBGetPluginSetting(std::string const &name, tstring const &defValue)
diff --git a/plugins/StopSpamPlus/src/settings.h b/plugins/StopSpamPlus/src/settings.h
index 99aa9322e8..86219ebf10 100644
--- a/plugins/StopSpamPlus/src/settings.h
+++ b/plugins/StopSpamPlus/src/settings.h
@@ -1,6 +1,6 @@
#pragma once
-#include "../headers.h"
+#include "headers.h"
class db_usage
{
diff --git a/plugins/StopSpamPlus/src/stopspam.cpp b/plugins/StopSpamPlus/src/stopspam.cpp
index 72d5e175c6..e58b8846ff 100644
--- a/plugins/StopSpamPlus/src/stopspam.cpp
+++ b/plugins/StopSpamPlus/src/stopspam.cpp
@@ -1,4 +1,4 @@
-#include "../headers.h"
+#include "headers.h"
HANDLE hFunc, hTempRemove, hLoadHook;
int hLangpack;
diff --git a/plugins/StopSpamPlus/src/utils.cpp b/plugins/StopSpamPlus/src/utils.cpp
index 673a858ad2..7d8bc28050 100644
--- a/plugins/StopSpamPlus/src/utils.cpp
+++ b/plugins/StopSpamPlus/src/utils.cpp
@@ -1,4 +1,4 @@
-#include "../headers.h"
+#include "headers.h"
tstring &GetDlgItemString(HWND hwnd, int id)
diff --git a/plugins/StopSpamPlus/src/version.h b/plugins/StopSpamPlus/src/version.h
new file mode 100644
index 0000000000..feb992d6a3
--- /dev/null
+++ b/plugins/StopSpamPlus/src/version.h
@@ -0,0 +1,51 @@
+// Set the version number here - it will affect the version resource and the version field of the pluginInfo structure
+// (Be careful that you don't have the resource file open when you change this and rebuild, otherwise the changes may not
+// take effect within the version resource)
+// Do not forget to define symbol "_DEBUG" for resource compiler if you use debug configuration (in VisualStudio you can
+// find it under Project properties - Configuration properties - Resource - General - Preprocessor definitions)
+
+// plugin version part
+#define __MAJOR_VERSION 0
+#define __MINOR_VERSION 0
+#define __RELEASE_NUM 1
+#define __BUILD_NUM 4
+// plugin SVN Revision number
+#define __REV_NUM 1548
+
+// minimal MirandaIM version number, with which this plugin supposed to work
+#define __PROD_MAJOR_VERSION 0
+#define __PROD_MINOR_VERSION 8
+#define __PROD_RELEASE_NUM 0
+#define __PROD_BUILD_NUM 0
+// if your plugin works only with Miranda core beginning from specific revision, you can include this information in Product Version resource
+//#define __PROD_REV_NUM 1234
+
+// stuff that will be used in PluginInfo section and in Version resource
+#define __PLUGIN_NAME "StopSpam+"
+#define __FILENAME "StopSpam.dll"
+#define __DESC "No more spam! Robots can't go! Only human beings invited!"
+#define __AUTHOR "Roman Miklashevsky, A. Petkevich, Kosh&chka, persei"
+#define __AUTHOREMAIL "koshechka@miranda.im"
+#define __AUTHORWEB "http://nightly.miranda.im/"
+#define __COPYRIGHT "© 2004-2010 Roman Miklashevsky, A. Petkevich, Kosh&chka, persei"
+
+// other stuff for Version resource
+#define __STRINGIFY_IMPL(x) #x
+#define __STRINGIFY(x) __STRINGIFY_IMPL(x)
+
+#define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM
+#define __FILEVERSION_STRING_DOTS __MAJOR_VERSION.__MINOR_VERSION.__RELEASE_NUM.__BUILD_NUM
+
+#ifdef __REV_NUM
+#define __VERSION_STRING __STRINGIFY(__FILEVERSION_STRING_DOTS rev. __REV_NUM)
+#else
+#define __VERSION_STRING __STRINGIFY(__FILEVERSION_STRING_DOTS)
+#endif
+
+#define __PRODVERSION_STRING __PROD_MAJOR_VERSION,__PROD_MINOR_VERSION,__PROD_RELEASE_NUM,__PROD_BUILD_NUM
+#define __PRODVERSION_STRING_DOTS __PROD_MAJOR_VERSION.__PROD_MINOR_VERSION.__PROD_RELEASE_NUM.__PROD_BUILD_NUM
+#ifdef __PROD_REV_NUM
+#define __PROD_VERSION_STRING __STRINGIFY(__PRODVERSION_STRING_DOTS rev. __PROD_REV_NUM)
+#else
+#define __PROD_VERSION_STRING __STRINGIFY(__PRODVERSION_STRING_DOTS+)
+#endif