From 0b248348eb0126d80d98c93787fd0348c36439d6 Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 17 Dec 2019 17:01:15 +0100 Subject: [PATCH 1/2] Fix mute/unmute button in contacts --- www/common/messenger-ui.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/www/common/messenger-ui.js b/www/common/messenger-ui.js index 941eb86e1..4d782827b 100644 --- a/www/common/messenger-ui.js +++ b/www/common/messenger-ui.js @@ -491,15 +491,8 @@ define([ }; var unmuteUser = function (curve) { - execCommand('UNMUTE_USER', curve, function (e, data) { + execCommand('UNMUTE_USER', curve, function (e) { if (e) { return void console.error(e); } - var $button = $('.cp-contacts-muted-user').find('button[data-user="'+curve+'"]'); - $button.closest('div').remove(); - if (!data) { $button.hide(); } - $('.cp-app-contacts-friend[data-user="'+curve+'"]') - .find('.cp-unmute-icon').show(); - $('.cp-app-contacts-friend[data-user="'+curve+'"]') - .find('.cp-mute-icon').show(); }); }; var muteUser = function (data) { @@ -567,7 +560,7 @@ define([ if (friendData.profile) { window.open(origin + '/profile/#' + friendData.profile); } }); - $(unmute).click(function (e) { + $(unmute).on('click dblclick', function (e) { e.stopPropagation(); var channel = state.channels[id]; if (!channel.isFriendChat) { return; } @@ -577,7 +570,7 @@ define([ unmuteUser(curvePublic); }); - $(mute).click(function (e) { + $(mute).on('click dblclick', function (e) { e.stopPropagation(); var channel = state.channels[id]; if (!channel.isFriendChat) { return; } @@ -863,6 +856,10 @@ define([ var $button = $userlist.find('.cp-app-contacts-muted-button'); + $('.cp-app-contacts-friend[data-user]') + .find('.cp-mute-icon').show(); + $('.cp-app-contacts-friend[data-user]') + .find('.cp-unmute-icon').hide(); if (!muted || Object.keys(muted).length === 0) { $button.hide(); return; @@ -871,6 +868,8 @@ define([ var rows = Object.keys(muted).map(function (curve) { $('.cp-app-contacts-friend[data-user="'+curve+'"]') .find('.cp-mute-icon').hide(); + $('.cp-app-contacts-friend[data-user="'+curve+'"]') + .find('.cp-unmute-icon').show(); var data = muted[curve]; var avatar = h('span.cp-avatar'); var button = h('button', { From 4cc2da72226305535f484288eef4b9c49f8e4c8d Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 17 Dec 2019 17:03:56 +0100 Subject: [PATCH 2/2] Fix HTML message displayed as text in profile --- www/profile/inner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/profile/inner.js b/www/profile/inner.js index fdbf50dd3..e9c142777 100644 --- a/www/profile/inner.js +++ b/www/profile/inner.js @@ -306,7 +306,7 @@ define([ refreshMute(data); }); }).appendTo($mute); - $(h('p', Messages.contacts_muteInfo)).appendTo($mute); + $(UI.setHTML(h('p'), Messages.contacts_muteInfo)).appendTo($mute); }); };