refactor: Use message/topic in muting_ui.toggle_mute().

This commit is contained in:
Steve Howell 2018-12-22 18:18:59 +00:00 committed by Tim Abbott
parent 411743e6dd
commit 1903cc8ac7
1 changed files with 8 additions and 5 deletions

View File

@ -196,11 +196,14 @@ exports.unmute = function (stream_id, topic) {
exports.dismiss_mute_confirmation();
};
exports.toggle_mute = function (msg) {
if (muting.is_topic_muted(msg.stream_id, msg.subject)) {
exports.unmute(msg.stream_id, msg.subject);
} else if (msg.type === 'stream') {
exports.mute(msg.stream_id, msg.subject);
exports.toggle_mute = function (message) {
var stream_id = message.stream_id;
var topic = util.get_message_topic(message);
if (muting.is_topic_muted(stream_id, topic)) {
exports.unmute(stream_id, topic);
} else if (message.type === 'stream') {
exports.mute(stream_id, topic);
}
};