diff --git a/client/components/MessageTypes/mode_user.vue b/client/components/MessageTypes/mode_user.vue new file mode 100644 index 00000000..8c3185eb --- /dev/null +++ b/client/components/MessageTypes/mode_user.vue @@ -0,0 +1,15 @@ + + + diff --git a/client/css/style.css b/client/css/style.css index 1ce106b6..6e2761de 100644 --- a/client/css/style.css +++ b/client/css/style.css @@ -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; diff --git a/src/models/msg.js b/src/models/msg.js index 705f4e1d..ed2ce6e5 100644 --- a/src/models/msg.js +++ b/src/models/msg.js @@ -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", diff --git a/src/plugins/irc-events/mode.js b/src/plugins/irc-events/mode.js index 9c9bf6b2..8046207f 100644 --- a/src/plugins/irc-events/mode.js +++ b/src/plugins/irc-events/mode.js @@ -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;