Display current channel mode on /mode command

Fixes #885
This commit is contained in:
Pavel Djundik 2019-03-07 12:57:31 +02:00
parent cac2ef65b7
commit 71332f59d9
4 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,15 @@
<template>
<span class="content">
Channel mode is <b>{{ message.text }}</b>
</span>
</template>
<script>
export default {
name: "MessageChannelMode",
props: {
network: Object,
message: Object,
},
};
</script>

View File

@ -260,6 +260,7 @@ kbd {
#chat .part .from::before, #chat .part .from::before,
#chat .quit .from::before, #chat .quit .from::before,
#chat .topic .from::before, #chat .topic .from::before,
#chat .mode_channel .from::before,
#chat .mode .from::before, #chat .mode .from::before,
#chat .motd .from::before, #chat .motd .from::before,
#chat .ctcp .from::before, #chat .ctcp .from::before,
@ -377,6 +378,7 @@ kbd {
color: #2ecc40; color: #2ecc40;
} }
#chat .mode_channel .from::before,
#chat .mode .from::before { #chat .mode .from::before {
content: "\f05a"; /* http://fontawesome.io/icon/info-circle/ */ content: "\f05a"; /* http://fontawesome.io/icon/info-circle/ */
color: #2ecc40; color: #2ecc40;

View File

@ -45,6 +45,7 @@ class Msg {
return this.type !== Msg.Type.MOTD && return this.type !== Msg.Type.MOTD &&
this.type !== Msg.Type.ERROR && this.type !== Msg.Type.ERROR &&
this.type !== Msg.Type.TOPIC_SET_BY && this.type !== Msg.Type.TOPIC_SET_BY &&
this.type !== Msg.Type.MODE_CHANNEL &&
this.type !== Msg.Type.WHOIS; this.type !== Msg.Type.WHOIS;
} }
} }
@ -60,6 +61,7 @@ Msg.Type = {
KICK: "kick", KICK: "kick",
MESSAGE: "message", MESSAGE: "message",
MODE: "mode", MODE: "mode",
MODE_CHANNEL: "mode_channel",
MOTD: "motd", MOTD: "motd",
NICK: "nick", NICK: "nick",
NOTICE: "notice", NOTICE: "notice",

View File

@ -31,6 +31,12 @@ module.exports = function(irc, network) {
client.save(); 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) { irc.on("mode", function(data) {