diff options
Diffstat (limited to 'plugins/NoHistory/src')
-rw-r--r-- | plugins/NoHistory/src/dllmain.cpp | 34 | ||||
-rw-r--r-- | plugins/NoHistory/src/icons.cpp | 2 | ||||
-rw-r--r-- | plugins/NoHistory/src/options.cpp | 4 | ||||
-rw-r--r-- | plugins/NoHistory/src/stdafx.h | 6 |
4 files changed, 24 insertions, 22 deletions
diff --git a/plugins/NoHistory/src/dllmain.cpp b/plugins/NoHistory/src/dllmain.cpp index 3f3e1a8ae5..535c9fde4a 100644 --- a/plugins/NoHistory/src/dllmain.cpp +++ b/plugins/NoHistory/src/dllmain.cpp @@ -12,8 +12,8 @@ HGENMENU hMenuToggle, hMenuClear; mir_cs list_cs;
-#define MS_NOHISTORY_TOGGLE MODULE "/ToggleOnOff"
-#define MS_NOHISTORY_CLEAR MODULE "/Clear"
+#define MS_NOHISTORY_TOGGLE MODULENAME "/ToggleOnOff"
+#define MS_NOHISTORY_CLEAR MODULENAME "/Clear"
#define DBSETTING_REMOVE "RemoveHistory"
@@ -27,7 +27,7 @@ struct EventListNode { EventListNode *event_list = nullptr;
// plugin stuff
-PLUGININFOEX pluginInfo =
+PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -41,9 +41,13 @@ PLUGININFOEX pluginInfo = {0xb25e8c7b, 0x292b, 0x495a, {0x9f, 0xb8, 0xa4, 0xc3, 0xd4, 0xee, 0xb0, 0x4b}}
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec (dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -70,7 +74,7 @@ void RemoveReadEvents(MCONTACT hContact = 0) }
if (remove) {
- if (db_get_b(node->hContact, MODULE, DBSETTING_REMOVE, 0)) // is history disabled for this contact?
+ if (db_get_b(node->hContact, MODULENAME, DBSETTING_REMOVE, 0)) // is history disabled for this contact?
db_event_delete(node->hContact, node->hDBEvent);
// remove list node anyway
@@ -107,7 +111,7 @@ void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD) int OnDatabaseEventAdd(WPARAM hContact, LPARAM hDBEvent)
{
// history not disabled for this contact
- if (db_get_b(hContact, MODULE, DBSETTING_REMOVE, 0) == 0)
+ if (db_get_b(hContact, MODULENAME, DBSETTING_REMOVE, 0) == 0)
return 0;
DBEVENTINFO info = {};
@@ -136,7 +140,7 @@ INT_PTR ServiceClear(WPARAM hContact, LPARAM) int PrebuildContactMenu(WPARAM hContact, LPARAM)
{
- bool remove = db_get_b(hContact, MODULE, DBSETTING_REMOVE, 0) != 0;
+ bool remove = db_get_b(hContact, MODULENAME, DBSETTING_REMOVE, 0) != 0;
char *proto = GetContactProto(hContact);
bool chat_room = (proto && db_get_b(hContact, proto, "ChatRoom", 0) != 0);
@@ -155,12 +159,12 @@ int PrebuildContactMenu(WPARAM hContact, LPARAM) INT_PTR ServiceToggle(WPARAM hContact, LPARAM)
{
- int remove = db_get_b(hContact, MODULE, DBSETTING_REMOVE, 0) != 0;
+ int remove = db_get_b(hContact, MODULENAME, DBSETTING_REMOVE, 0) != 0;
remove = !remove;
- db_set_b(hContact, MODULE, DBSETTING_REMOVE, remove != 0);
+ db_set_b(hContact, MODULENAME, DBSETTING_REMOVE, remove != 0);
StatusIconData sid = {};
- sid.szModule = MODULE;
+ sid.szModule = MODULENAME;
for (int i = 0; i < 2; ++i) {
sid.dwId = i;
@@ -183,10 +187,10 @@ int WindowEvent(WPARAM, LPARAM lParam) case MSG_WINDOW_EVT_OPEN:
char *proto = GetContactProto(hContact);
bool chat_room = (proto && db_get_b(hContact, proto, "ChatRoom", 0) != 0);
- int remove = db_get_b(hContact, MODULE, DBSETTING_REMOVE, 0) != 0;
+ int remove = db_get_b(hContact, MODULENAME, DBSETTING_REMOVE, 0) != 0;
StatusIconData sid = {};
- sid.szModule = MODULE;
+ sid.szModule = MODULENAME;
for (int i=0; i < 2; ++i) {
sid.dwId = i;
sid.flags = (chat_room ? MBF_HIDDEN : (i == remove) ? 0 : MBF_HIDDEN);
@@ -204,7 +208,7 @@ int IconPressed(WPARAM hContact, LPARAM lParam) return 0;
if (sicd->flags & MBCF_RIGHTBUTTON) return 0; // ignore right-clicks
- if (mir_strcmp(sicd->szModule, MODULE) != 0) return 0; // not our event
+ if (mir_strcmp(sicd->szModule, MODULENAME) != 0) return 0; // not our event
char *proto = GetContactProto(hContact);
bool chat_room = (proto && db_get_b(hContact, proto, "ChatRoom", 0) != 0);
@@ -219,7 +223,7 @@ int IconPressed(WPARAM hContact, LPARAM lParam) void SrmmMenu_Load()
{
StatusIconData sid = {};
- sid.szModule = MODULE;
+ sid.szModule = MODULENAME;
sid.dwId = 0;
sid.szTooltip = LPGEN("History Enabled");
@@ -265,7 +269,7 @@ static int ModulesLoaded(WPARAM, LPARAM) extern "C" __declspec (dllexport) int Load()
{
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
// Ensure that the common control DLL is loaded (for listview)
INITCOMMONCONTROLSEX icex = { sizeof(icex), ICC_LISTVIEW_CLASSES };
diff --git a/plugins/NoHistory/src/icons.cpp b/plugins/NoHistory/src/icons.cpp index f9f50f3595..0fb6176f81 100644 --- a/plugins/NoHistory/src/icons.cpp +++ b/plugins/NoHistory/src/icons.cpp @@ -19,7 +19,7 @@ int ReloadIcons(WPARAM, LPARAM) void InitIcons()
{
- g_plugin.registerIcon(LPGEN("No History"), iconList, MODULE);
+ g_plugin.registerIcon(LPGEN("No History"), iconList, MODULENAME);
ReloadIcons(0, 0);
diff --git a/plugins/NoHistory/src/options.cpp b/plugins/NoHistory/src/options.cpp index da4d9555d2..4cb6b5fd65 100644 --- a/plugins/NoHistory/src/options.cpp +++ b/plugins/NoHistory/src/options.cpp @@ -84,7 +84,7 @@ static void SetAllContactIcons(HWND hwndList) if (!chat_room) {
HANDLE hItem=(HANDLE)SendMessage(hwndList,CLM_FINDCONTACT,hContact,0);
if (hItem) {
- bool disabled = (db_get_b(hContact, MODULE, DBSETTING_REMOVE, 0) == 1);
+ bool disabled = (db_get_b(hContact, MODULENAME, DBSETTING_REMOVE, 0) == 1);
SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(0,disabled?1:0));
}
}
@@ -199,7 +199,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA HANDLE hItem = (HANDLE)SendMessage(hwndList,CLM_FINDCONTACT,hContact,0);
if (hItem) {
int iImage = SendMessage(hwndList,CLM_GETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(0,0));
- db_set_b(hContact, MODULE, DBSETTING_REMOVE, iImage==1?1:0);
+ db_set_b(hContact, MODULENAME, DBSETTING_REMOVE, iImage==1?1:0);
}
}
}
diff --git a/plugins/NoHistory/src/stdafx.h b/plugins/NoHistory/src/stdafx.h index 295a3b01df..76962ba8f6 100644 --- a/plugins/NoHistory/src/stdafx.h +++ b/plugins/NoHistory/src/stdafx.h @@ -21,15 +21,13 @@ #include "options.h"
#include "version.h"
-#define MODULE "NoHistory"
+#define MODULENAME "NoHistory"
#define DBSETTING_REMOVE "RemoveHistory"
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(MODULE)
- {}
+ CMPlugin();
};
void SrmmMenu_Load();
|