Added MOTD messages

This commit is contained in:
Mattias Erming 2014-09-11 10:24:32 -07:00
parent b1217aa416
commit 666f21cd66
6 changed files with 25 additions and 16 deletions

File diff suppressed because one or more lines are too long

View file

@ -514,9 +514,10 @@ button {
color: #f00;
}
#chat.hide-join .join span,
#chat.hide-mode .mode span,
#chat.hide-motd .motd span,
#chat.hide-nick .nick span,
#chat.hide-part .part span,
#chat.hide-mode .mode span,
#chat.hide-quit .quit span {
display: none !important;
}

View file

@ -135,6 +135,12 @@
Show joins
</label>
</div>
<div class="col-sm-6">
<label class="opt">
<input type="checkbox" name="motd">
Show motd
</label>
</div>
<div class="col-sm-6">
<label class="opt">
<input type="checkbox" name="nick">

View file

@ -250,6 +250,7 @@ $(function() {
var options = $.extend({
join: true,
mode: true,
motd: false,
nick: true,
notification: true,
part: true,
@ -269,9 +270,10 @@ $(function() {
$.cookie("settings", options);
if ([
"join",
"mode",
"motd",
"nick",
"part",
"mode",
"quit",
].indexOf(name) !== -1) {
chat.toggleClass("hide-" + name, !self.prop("checked"));

View file

@ -1,7 +1,7 @@
{
"name": "shout",
"description": "A web IRC client",
"version": "0.23.2",
"version": "0.23.3",
"author": "Mattias Erming",
"preferGlobal": true,
"bin": {

View file

@ -3,17 +3,17 @@ var Msg = require("../../models/msg");
module.exports = function(irc, network) {
var client = this;
irc.on("motd", function(data) {
//var lobby = network.channels[0];
//data.motd.forEach(function(text) {
// var msg = new Msg({
// type: Msg.Type.MOTD,
// text: text
// });
// lobby.messages.push(msg);
// client.emit("msg", {
// chan: lobby.id,
// msg: msg
// });
//});
var lobby = network.channels[0];
data.motd.forEach(function(text) {
var msg = new Msg({
type: Msg.Type.MOTD,
text: text
});
lobby.messages.push(msg);
client.emit("msg", {
chan: lobby.id,
msg: msg
});
});
});
};