diff options
author | George Hazan <george.hazan@gmail.com> | 2024-10-15 20:00:52 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-10-15 20:00:52 +0300 |
commit | 47b79689fcbe77ab19eb577487ef70642fa291f7 (patch) | |
tree | 0a3b3c0679346ff1d49f6f7f898f71001459de47 /plugins/NewStory/src/main.cpp | |
parent | b210af86bcfb49c791ef8f74f0791ff6d36763bd (diff) |
fixes #4720 (NewStory: встроить функциональность MessageState)
Diffstat (limited to 'plugins/NewStory/src/main.cpp')
-rw-r--r-- | plugins/NewStory/src/main.cpp | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/plugins/NewStory/src/main.cpp b/plugins/NewStory/src/main.cpp index 3271b9fe48..e497dce495 100644 --- a/plugins/NewStory/src/main.cpp +++ b/plugins/NewStory/src/main.cpp @@ -94,33 +94,24 @@ static IconItem icons[] = { LPGEN("Template group"), "tplgroup", IDI_TPLGROUP },
{ LPGEN("Cancel edit"), "reset", IDI_RESET },
{ LPGEN("Downloaded"), "downloaded", IDI_OK },
+ { LPGEN("Delivered"), "delivered", IDI_DELIVERED },
+ { LPGEN("Remote read"), "remoteread", IDI_REMOTEREAD },
{ LPGEN("Help"), "varhelp", IDI_VARHELP }
};
-static int SmartSendEvent(int iEvent, MCONTACT hContact, LPARAM lParam)
+static int evtEventAdded(WPARAM hContact, LPARAM lParam)
{
- if (HWND hwnd = WindowList_Find(g_hNewstoryLogs, hContact))
- SendMessage(hwnd, iEvent, hContact, lParam);
-
- if (db_mc_isMeta(hContact)) {
- // Send a message to a real contact too
- MCONTACT cc = db_event_getContact(lParam);
- if (cc != hContact)
- if (HWND hwnd = WindowList_Find(g_hNewstoryLogs, cc))
- SendMessage(hwnd, iEvent, cc, lParam);
- }
-
- return 0;
+ return SmartSendEvent(UM_ADD_EVENT, hContact, lParam);
}
-static int evtEventAdded(WPARAM hContact, LPARAM lParam)
+static int evtEventDeleted(WPARAM hContact, LPARAM hEvent)
{
- return SmartSendEvent(UM_ADD_EVENT, hContact, lParam);
+ return (g_plugin.bDisableDelete) ? 0 : SmartSendEvent(UM_REMOVE_EVENT, hContact, hEvent);
}
-static int evtEventDeleted(WPARAM hContact, LPARAM lParam)
+static int evtEventDelivered(WPARAM hContact, LPARAM hEvent)
{
- return (g_plugin.bDisableDelete) ? 0 : SmartSendEvent(UM_REMOVE_EVENT, hContact, lParam);
+ return SmartSendEvent(UM_DELIVER_EVENT, hContact, hEvent);
}
static int evtEventEdited(WPARAM hContact, LPARAM lParam)
@@ -198,6 +189,7 @@ int CMPlugin::Load() HookEvent(ME_DB_EVENT_ADDED, evtEventAdded);
HookEvent(ME_DB_EVENT_DELETED, evtEventDeleted);
+ HookEvent(ME_DB_EVENT_DELIVERED, evtEventDelivered);
HookEvent(ME_DB_EVENT_EDITED, evtEventEdited);
HookEvent(ME_DB_EVENT_SETJSON, evtEventEdited);
HookEvent(ME_OPT_INITIALISE, OptionsInitialize);
|