summaryrefslogtreecommitdiff
path: root/src/mir_app/src/chat_svc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mir_app/src/chat_svc.cpp')
-rw-r--r--src/mir_app/src/chat_svc.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/mir_app/src/chat_svc.cpp b/src/mir_app/src/chat_svc.cpp
index d893a2c754..9e6a89ea3f 100644
--- a/src/mir_app/src/chat_svc.cpp
+++ b/src/mir_app/src/chat_svc.cpp
@@ -802,6 +802,9 @@ static INT_PTR LeaveChat(WPARAM hContact, LPARAM)
static int OnEventAdded(WPARAM hContact, LPARAM hDbEvent)
{
+ if (hContact == 0)
+ return 0;
+
if (Contact::IsGroupChat(hContact)) {
if (auto *si = SM_FindSessionByContact(hContact)) {
DB::EventInfo dbei;
@@ -822,6 +825,20 @@ static int OnEventAdded(WPARAM hContact, LPARAM hDbEvent)
}
}
}
+ else {
+ g_clistApi.pfnRemoveEvent(hContact, 1);
+
+ DBEVENTINFO dbei = {};
+ if (!db_event_get(hDbEvent, &dbei)) {
+ if (auto *pDlg = Srmm_FindDialog(hContact))
+ pDlg->EventAdded(hDbEvent, dbei);
+
+ MCONTACT hRealContact = db_event_getContact(hDbEvent);
+ if (hRealContact != hContact)
+ if (auto *pDlg = Srmm_FindDialog(hRealContact))
+ pDlg->EventAdded(hDbEvent, dbei);
+ }
+ }
return 0;
}