summaryrefslogtreecommitdiff
path: root/src/modules/metacontacts/meta_services.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-06-26 20:51:15 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-06-26 20:51:15 +0000
commit0aa2efe942651ba850357c5b6bb23fc5f5691512 (patch)
tree869ec97dccda1aeb36ad46b6e6be3cd0063f5215 /src/modules/metacontacts/meta_services.cpp
parentc48c2317050a91f175d08619cfc407dff4f4d7b7 (diff)
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
Diffstat (limited to 'src/modules/metacontacts/meta_services.cpp')
-rw-r--r--src/modules/metacontacts/meta_services.cpp16
1 files changed, 11 insertions, 5 deletions
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);
}