From 71332f59d9a951c5131fd6339412b500865f3965 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Thu, 7 Mar 2019 12:57:31 +0200 Subject: [PATCH] Display current channel mode on /mode command Fixes #885 --- client/components/MessageTypes/mode_channel.vue | 15 +++++++++++++++ client/css/style.css | 2 ++ src/models/msg.js | 2 ++ src/plugins/irc-events/mode.js | 6 ++++++ 4 files changed, 25 insertions(+) create mode 100644 client/components/MessageTypes/mode_channel.vue diff --git a/client/components/MessageTypes/mode_channel.vue b/client/components/MessageTypes/mode_channel.vue new file mode 100644 index 00000000..109950bf --- /dev/null +++ b/client/components/MessageTypes/mode_channel.vue @@ -0,0 +1,15 @@ + + + diff --git a/client/css/style.css b/client/css/style.css index 69b4f32e..0e5854df 100644 --- a/client/css/style.css +++ b/client/css/style.css @@ -260,6 +260,7 @@ kbd { #chat .part .from::before, #chat .quit .from::before, #chat .topic .from::before, +#chat .mode_channel .from::before, #chat .mode .from::before, #chat .motd .from::before, #chat .ctcp .from::before, @@ -377,6 +378,7 @@ kbd { color: #2ecc40; } +#chat .mode_channel .from::before, #chat .mode .from::before { content: "\f05a"; /* http://fontawesome.io/icon/info-circle/ */ color: #2ecc40; diff --git a/src/models/msg.js b/src/models/msg.js index f38147eb..c74c03e0 100644 --- a/src/models/msg.js +++ b/src/models/msg.js @@ -45,6 +45,7 @@ class Msg { return this.type !== Msg.Type.MOTD && this.type !== Msg.Type.ERROR && this.type !== Msg.Type.TOPIC_SET_BY && + this.type !== Msg.Type.MODE_CHANNEL && this.type !== Msg.Type.WHOIS; } } @@ -60,6 +61,7 @@ Msg.Type = { KICK: "kick", MESSAGE: "message", MODE: "mode", + MODE_CHANNEL: "mode_channel", MOTD: "motd", NICK: "nick", NOTICE: "notice", diff --git a/src/plugins/irc-events/mode.js b/src/plugins/irc-events/mode.js index 534a9fa9..1783337c 100644 --- a/src/plugins/irc-events/mode.js +++ b/src/plugins/irc-events/mode.js @@ -31,6 +31,12 @@ module.exports = function(irc, network) { client.save(); } }); + + const msg = new Msg({ + type: Msg.Type.MODE_CHANNEL, + text: `${data.raw_modes} ${data.raw_params}`, + }); + targetChan.pushMessage(client, msg); }); irc.on("mode", function(data) {