Merge pull request #4427 from thelounge/bookworm/mode

handle RPL_UMODEIS
This commit is contained in:
John Sullivan 2021-12-06 13:38:29 -08:00 committed by GitHub
commit cd7916b6d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 43 additions and 9 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

@ -42,15 +42,19 @@ class Msg {
return !!this.from.nick;
}
return (
this.type !== Msg.Type.MONOSPACE_BLOCK &&
this.type !== Msg.Type.ERROR &&
this.type !== Msg.Type.TOPIC_SET_BY &&
this.type !== Msg.Type.MODE_CHANNEL &&
this.type !== Msg.Type.RAW &&
this.type !== Msg.Type.WHOIS &&
this.type !== Msg.Type.PLUGIN
);
switch (this.type) {
case Msg.Type.MONOSPACE_BLOCK:
case Msg.Type.ERROR:
case Msg.Type.TOPIC_SET_BY:
case Msg.Type.MODE_CHANNEL:
case Msg.Type.MODE_USER:
case Msg.Type.RAW:
case Msg.Type.WHOIS:
case Msg.Type.PLUGIN:
return false;
default:
return true;
}
}
}
@ -66,6 +70,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;