diff options
author | Nvinside <Nvinside@eced67a3-f377-a0ae-92ae-d6de1850b05a> | 2011-07-17 17:21:00 +0000 |
---|---|---|
committer | Nvinside <Nvinside@eced67a3-f377-a0ae-92ae-d6de1850b05a> | 2011-07-17 17:21:00 +0000 |
commit | e91fa6de03f2351bc128a015978a657409d351b4 (patch) | |
tree | 55c8a90307f62c7025e10f64f5680424da333da2 /MirOTR/svcs_srmm.cpp | |
parent | 730ca7df52f2d5bec80da755eac0f140f6be5929 (diff) |
finally a metacontacts solution by the_nic (thanks again)
git-svn-id: http://mirotr.googlecode.com/svn/trunk@59 eced67a3-f377-a0ae-92ae-d6de1850b05a
Diffstat (limited to 'MirOTR/svcs_srmm.cpp')
-rw-r--r-- | MirOTR/svcs_srmm.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/MirOTR/svcs_srmm.cpp b/MirOTR/svcs_srmm.cpp index 7df79a0..b8b8a87 100644 --- a/MirOTR/svcs_srmm.cpp +++ b/MirOTR/svcs_srmm.cpp @@ -197,10 +197,18 @@ void SetEncryptionStatus(HANDLE hContact, TrustLevel level) { if(!chat_room && options.bHaveMetaContacts) {
HANDLE hMeta = (HANDLE)CallService(MS_MC_GETMETACONTACT, (WPARAM)hContact, 0);
- if(hMeta && hContact == (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hMeta, 0)) {
+ HANDLE hMostOnline = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hMeta, 0);
+ if(hMeta && hContact == hMostOnline) {
//strcat(dbg_msg, "\nrecursing for meta");
SetEncryptionStatus(hMeta, level);
}
+ else if(hMeta) {
+ /* in case the new most online contact has changed
+ (e.g. when the otr subcontact goes offline) */
+ ConnContext *context = otrl_context_find_miranda(otr_user_state, hMostOnline);
+ TrustLevel encrypted = otr_context_get_trust(context);
+ SetEncryptionStatus(hMeta, encrypted);
+ }
}
}
//PUShowMessage(dbg_msg, SM_NOTIFY);
|