[704] in BarnOwl Developers

home help back first fref pref prev next nref lref last post

[D-O-H] r763 - trunk/owl/perl/modules/Jabber/lib/BarnOwl/Module

daemon@ATHENA.MIT.EDU (nelhage@MIT.EDU)
Thu Oct 29 18:08:51 2009

Resent-From: nelhage@mit.edu
Resent-To: barnowl-dev-mtg@charon.mit.edu
To: dirty-owl-hackers@mit.edu
From: nelhage@MIT.EDU
Reply-to: dirty-owl-hackers@MIT.EDU
Date: Wed, 12 Sep 2007 21:54:51 -0400 (EDT)

Author: nelhage
Date: 2007-09-12 21:54:51 -0400 (Wed, 12 Sep 2007)
New Revision: 763

Modified:
   trunk/owl/perl/modules/Jabber/lib/BarnOwl/Module/Jabber.pm
Log:
Validate JIDs passed to jmuc join. closes #25


Modified: trunk/owl/perl/modules/Jabber/lib/BarnOwl/Module/Jabber.pm
===================================================================
--- trunk/owl/perl/modules/Jabber/lib/BarnOwl/Module/Jabber.pm	2007-09-13 01:37:41 UTC (rev 762)
+++ trunk/owl/perl/modules/Jabber/lib/BarnOwl/Module/Jabber.pm	2007-09-13 01:54:51 UTC (rev 763)
@@ -580,15 +580,17 @@
     $muc = shift @ARGV
       or die("Usage: jmuc join MUC [-p password] [-a account]");
 
+    die("Error: Must specify a fully-qualified MUC name (e.g. barnowl\@conference.mit.edu)\n")
+        unless $muc =~ /@/;
     $muc = Net::Jabber::JID->new($muc);
     $jid = Net::Jabber::JID->new($jid);
     $muc->SetResource($jid->GetJID('full')) unless length $muc->GetResource();
 
     $conn->getConnectionFromJID($jid)->MUCJoin(JID      => $muc,
-                                                  Password => $password,
-                                                  History  => {
-                                                      MaxChars => 0
-                                                     });
+                                               Password => $password,
+                                               History  => {
+                                                   MaxChars => 0
+                                                  });
     return;
 }
 


home help back first fref pref prev next nref lref last post