Fix '/msg' and '/say' commands

This commit is contained in:
Mattias Erming 2014-08-02 05:08:26 -07:00
parent 7ceffbe3c3
commit f4dc6212e3
3 changed files with 14 additions and 11 deletions

View File

@ -1,5 +1,5 @@
{
"port": 9000,
"theme": "themes/example.css",
"public": false
"public": true
}

View File

@ -6,24 +6,27 @@ module.exports = function(network, chan, cmd, args) {
return;
}
var client = this;
var irc = network.irc;
if (args.length === 0 || args[0] === "") {
return;
}
var target = args[0].charAt(0) == "#" ? args[0] : chan.name;
if (target !== chan.name) {
chan = _.findWhere(network.channels, {
name: target
});
var client = this;
var irc = network.irc;
var target = "";
if (cmd == "msg") {
target = args.shift();
if (args.length === 0) {
return;
}
} else {
target = chan.name;
}
var text = args.join(" ");
irc.send(target, text);
if (typeof chan !== "undefined") {
if (target == chan.name && typeof chan !== "undefined") {
var msg = new Msg({
type: Msg.Type.MESSAGE,
from: irc.me,

View File

@ -1,7 +1,7 @@
{
"name": "shout",
"description": "A web IRC client",
"version": "0.8.6",
"version": "0.8.7",
"homepage": "http://github.com/erming/shout",
"author": {
"name": "Mattias Erming",