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 .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;

View file

@ -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",

View file

@ -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) {