From 0aa2efe942651ba850357c5b6bb23fc5f5691512 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 26 Jun 2014 20:51:15 +0000 Subject: fix for not setting the current sub from menu git-svn-id: http://svn.miranda-ng.org/main/trunk@9584 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/metacontacts/meta_services.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/modules/metacontacts') diff --git a/src/modules/metacontacts/meta_services.cpp b/src/modules/metacontacts/meta_services.cpp index d0759125dd..b95152925d 100644 --- a/src/modules/metacontacts/meta_services.cpp +++ b/src/modules/metacontacts/meta_services.cpp @@ -120,15 +120,20 @@ INT_PTR Meta_LoadIcon(WPARAM wParam,LPARAM lParam) ///////////////////////////////////////////////////////////////////////////////////////// +static void Meta_SetSrmmSub(MCONTACT hMeta, MCONTACT hSub) +{ + MetaSrmmData tmp = { hMeta }; + if (MetaSrmmData *p = arMetaWindows.find(&tmp)) + p->m_hSub = hSub; +} + static INT_PTR MetaFilter_RecvMessage(WPARAM wParam, LPARAM lParam) { CCSDATA *ccs = (CCSDATA*)lParam; DBCachedContact *cc = currDb->m_cache->GetCachedContact(ccs->hContact); - if (cc && cc->IsSub()) { - MetaSrmmData tmp = { cc->parentID }; - if (MetaSrmmData *p = arMetaWindows.find(&tmp)) - p->m_hSub = cc->contactID; - } + if (cc && cc->IsSub()) + Meta_SetSrmmSub(cc->parentID, cc->contactID); + CallService(MS_PROTO_CHAINRECV, wParam, lParam); return 0; } @@ -700,6 +705,7 @@ INT_PTR Meta_ContactMenuFunc(WPARAM hMeta, LPARAM lParam) INT_PTR caps = CallProtoService(proto, PS_GETCAPS, PFLAGNUM_1, 0); if ((caps & PF1_IMSEND) || (caps & PF1_CHAT)) { // set default contact for sending/status and open message window + Meta_SetSrmmSub(hMeta, hContact); db_mc_setDefaultNum(hMeta, lParam, false); CallService(MS_MSG_SENDMESSAGET, hMeta, 0); } -- cgit v1.2.3