Don't send a message if there are no listeners, duhhhhh;

This commit is contained in:
Benjamin Bouvier 2016-11-07 13:32:40 +01:00
parent 173381e242
commit febab43948

View File

@ -167,6 +167,9 @@ var handlers = {
function makeSay(body) { function makeSay(body) {
var whom = hookToChannel[body.object_kind] || []; var whom = hookToChannel[body.object_kind] || [];
return function say(msgs) { return function say(msgs) {
if (!whom.length) {
return;
}
if (msgs) { if (msgs) {
if (msgs instanceof Array) { if (msgs instanceof Array) {
for (var i = 0; i < msgs.length; i++) for (var i = 0; i < msgs.length; i++)