summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-08-17 17:44:21 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-08-17 17:44:21 +0300
commite7f076b81b324594ea81462322394534929f5244 (patch)
tree149fe69a2383da91c549fa0c1e1f9dea22775fee /plugins
parent2874e5b17395bf449e0b2a1f55233724216a7c7e (diff)
fixes #3641 ([NewStory] Content of contact's history is not refreshed until history is reopened)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/NewStory/src/history_control.cpp5
-rw-r--r--plugins/NewStory/src/main.cpp26
2 files changed, 23 insertions, 8 deletions
diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp
index 6ffcf45aa2..572c318a6b 100644
--- a/plugins/NewStory/src/history_control.cpp
+++ b/plugins/NewStory/src/history_control.cpp
@@ -781,6 +781,11 @@ LRESULT CALLBACK NewstoryListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
InvalidateRect(hwnd, 0, FALSE);
break;
+ case UM_ADDEVENT:
+ if (data->pMsgDlg == nullptr)
+ data->AddEvent(wParam, lParam, 1);
+ break;
+
case UM_EDITEVENT:
idx = data->items.find(lParam);
if (idx != -1) {
diff --git a/plugins/NewStory/src/main.cpp b/plugins/NewStory/src/main.cpp
index 9f3bea3aef..b97d6e300c 100644
--- a/plugins/NewStory/src/main.cpp
+++ b/plugins/NewStory/src/main.cpp
@@ -76,25 +76,35 @@ static IconItem icons[] =
{ LPGEN("Help"), "varhelp", IDI_VARHELP }
};
-static int evtEventAdded(WPARAM hContact, LPARAM lParam)
+static int SmartSendEvent(int iEvent, MCONTACT hContact, LPARAM lParam)
{
if (HWND hwnd = WindowList_Find(g_hNewstoryLogs, hContact))
- SendMessage(hwnd, UM_ADDEVENT, hContact, lParam);
+ 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;
}
+static int evtEventAdded(WPARAM hContact, LPARAM lParam)
+{
+ return SmartSendEvent(UM_ADDEVENT, hContact, lParam);
+}
+
static int evtEventDeleted(WPARAM hContact, LPARAM lParam)
{
- if (HWND hwnd = WindowList_Find(g_hNewstoryLogs, hContact))
- SendMessage(hwnd, UM_REMOVEEVENT, hContact, lParam);
- return 0;
+ return SmartSendEvent(UM_REMOVEEVENT, hContact, lParam);
}
static int evtEventEdited(WPARAM hContact, LPARAM lParam)
{
- if (HWND hwnd = WindowList_Find(g_hNewstoryLogs, hContact))
- SendMessage(hwnd, UM_EDITEVENT, hContact, lParam);
- return 0;
+ return SmartSendEvent(UM_EDITEVENT, hContact, lParam);
}
static int evtModulesLoaded(WPARAM, LPARAM)