Merge pull request #3109 from thelounge/xpaw/chan-mode-is

Display current channel mode on /mode command
This commit is contained in:
Jérémie Astori 2019-03-16 21:48:22 -04:00 committed by GitHub
commit f7ebff0b67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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) {