summaryrefslogtreecommitdiff
path: root/src/modules/metacontacts/meta_services.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/metacontacts/meta_services.cpp')
-rw-r--r--src/modules/metacontacts/meta_services.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/modules/metacontacts/meta_services.cpp b/src/modules/metacontacts/meta_services.cpp
index 6f7befc018..dbd04d6658 100644
--- a/src/modules/metacontacts/meta_services.cpp
+++ b/src/modules/metacontacts/meta_services.cpp
@@ -556,6 +556,18 @@ static int Meta_MessageWindowEvent(WPARAM wParam, LPARAM lParam)
return 0;
}
+static int Meta_EventAdded(WPARAM hMeta, LPARAM hDbEvent)
+{
+ MetaSrmmData tmp = { hMeta };
+ if (MetaSrmmData *p = arMetaWindows.find(&tmp)) {
+ DBEVENTINFO dbei = { sizeof(dbei) };
+ db_event_get(HANDLE(hDbEvent), &dbei);
+ if (dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_SENT))
+ p->m_hSub = db_event_getContact(HANDLE(hDbEvent));
+ }
+ return 0;
+}
+
// returns manually chosen sub in the meta window
static INT_PTR Meta_SrmmCurrentSub(WPARAM hMeta, LPARAM lParam)
{
@@ -891,6 +903,7 @@ void Meta_InitServices()
HookEvent(ME_PROTO_CONTACTISTYPING, Meta_ContactIsTyping);
HookEvent(ME_DB_CONTACT_DELETED, Meta_ContactDeleted);
HookEvent(ME_DB_CONTACT_SETTINGCHANGED, Meta_SettingChanged);
+ HookEvent(ME_DB_EVENT_ADDED, Meta_EventAdded);
HookEvent(ME_OPT_INITIALISE, Meta_OptInit);
HookEvent(ME_SYSTEM_MODULESLOADED, Meta_ModulesLoaded);
HookEvent(ME_SYSTEM_PRESHUTDOWN, Meta_PreShutdown);