summaryrefslogtreecommitdiff
path: root/MirOTR/svcs_srmm.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'MirOTR/svcs_srmm.cpp')
-rw-r--r--MirOTR/svcs_srmm.cpp10
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);