Always send notices for non existing targets into server window

This matches current master behaviour
This commit is contained in:
Pavel Djundik 2016-03-22 13:08:10 +02:00 committed by Maxime Poulin
parent d1da4b338a
commit 6b2ebd790d

View File

@ -33,18 +33,16 @@ module.exports = function(irc, network) {
chan = network.channels[0];
} else {
var target = data.target;
var targetedAtUser = false;
// If the message is targeted at us, use sender as target instead
if (target.toLowerCase() === irc.user.nick.toLowerCase()) {
targetedAtUser = true;
target = data.nick;
}
var chan = network.getChannel(target);
if (typeof chan === "undefined") {
// Send notices that are not targeted at us into the server window
if (data.type === Msg.Type.NOTICE && !targetedAtUser) {
if (data.type === Msg.Type.NOTICE) {
chan = network.channels[0];
} else {
chan = new Chan({