From: Charles McGarvey Date: Wed, 4 Jan 2012 02:50:17 +0000 (-0700) Subject: validate sent chat to avoid spurious join messages X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=57f9bfbe0bd9f89a602c5f16bff100af84ae7f83;p=chaz%2Fchatty validate sent chat to avoid spurious join messages --- diff --git a/lib/Chatty/Controller/Chat.pm b/lib/Chatty/Controller/Chat.pm index 911c127..01cb234 100644 --- a/lib/Chatty/Controller/Chat.pm +++ b/lib/Chatty/Controller/Chat.pm @@ -95,7 +95,8 @@ sub view :Chained(room) :PathPart('') :Args(1) { my $name = $c->user->obj->username; my $msg = $c->req->param('msg'); - if ($msg) { + if (defined $msg) { + return if $msg eq ''; $c->model('Meteor')->addMessage($room, "$name: $msg"); $c->stash->{json} = \1; $c->forward('View::JSON');