Add RPL_UMODEIS msg handler

This commit is contained in:
Reto Brunner 2021-12-04 11:42:36 +01:00
parent 4065d5de97
commit 1953e03253
4 changed files with 31 additions and 0 deletions

View File

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

View File

@ -308,6 +308,7 @@ p {
#chat .msg[data-type="quit"] .from::before,
#chat .msg[data-type="topic"] .from::before,
#chat .msg[data-type="mode_channel"] .from::before,
#chat .msg[data-type="mode_user"] .from::before,
#chat .msg[data-type="mode"] .from::before,
#chat .msg[data-command="motd"] .from::before,
#chat .msg[data-command="help"] .from::before,
@ -434,6 +435,7 @@ p {
}
#chat .msg[data-type="mode_channel"] .from::before,
#chat .msg[data-type="mode_user"] .from::before,
#chat .msg[data-type="mode"] .from::before {
content: "\f05a"; /* http://fontawesome.io/icon/info-circle/ */
color: #2ecc40;

View File

@ -47,6 +47,7 @@ class Msg {
this.type !== Msg.Type.ERROR &&
this.type !== Msg.Type.TOPIC_SET_BY &&
this.type !== Msg.Type.MODE_CHANNEL &&
this.type !== Msg.Type.MODE_USER &&
this.type !== Msg.Type.RAW &&
this.type !== Msg.Type.WHOIS &&
this.type !== Msg.Type.PLUGIN
@ -66,6 +67,7 @@ Msg.Type = {
MESSAGE: "message",
MODE: "mode",
MODE_CHANNEL: "mode_channel",
MODE_USER: "mode_user", // RPL_UMODEIS
MONOSPACE_BLOCK: "monospace_block",
NICK: "nick",
NOTICE: "notice",

View File

@ -39,6 +39,18 @@ module.exports = function (irc, network) {
targetChan.pushMessage(client, msg);
});
irc.on("user info", function (data) {
const serverChan = network.channels[0];
const msg = new Msg({
type: Msg.Type.MODE_USER,
raw_modes: data.raw_modes,
self: false,
showInActive: true,
});
serverChan.pushMessage(client, msg);
});
irc.on("mode", function (data) {
let targetChan;