[312] in BarnOwl Developers
[D-O-H] r458 - / trunk/owl/perl/modules
daemon@ATHENA.MIT.EDU (nelhage@MIT.EDU)
Thu Oct 29 18:04:47 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: Fri, 10 Nov 2006 13:13:37 -0500 (EST)
Author: nelhage
Date: 2006-11-10 13:13:37 -0500 (Fri, 10 Nov 2006)
New Revision: 458
Modified:
/
trunk/owl/perl/modules/jabber.pl
Log:
r23953@heretique: nelhage | 2006-11-10 13:11:13 -0500
Refactoring jmuc_invite slightly
Property changes on:
___________________________________________________________________
Name: svk:merge
- 6122c8b4-0e12-0410-9533-8bcd7c66c992:/local/dirty-owl-hacks:23951
6aa88b72-b502-0410-8cb4-a5dd0230fb79:/owl-local:1356
+ 6122c8b4-0e12-0410-9533-8bcd7c66c992:/local/dirty-owl-hacks:23953
6aa88b72-b502-0410-8cb4-a5dd0230fb79:/owl-local:1356
Modified: trunk/owl/perl/modules/jabber.pl
===================================================================
--- trunk/owl/perl/modules/jabber.pl 2006-11-10 17:57:08 UTC (rev 457)
+++ trunk/owl/perl/modules/jabber.pl 2006-11-10 18:13:37 UTC (rev 458)
@@ -145,7 +145,8 @@
. "invite {jid} [muc]\n"
. " Invite {jid} to [muc].\n"
. " The muc is taken from the current message if not supplied.\n\n"
- . "configure [muc]\n" " Configure [muc].\n"
+ . "configure [muc]\n"
+ . " Configure [muc].\n"
. " Necessary to initalize a new MUC",
usage => "jmuc {command} {args}"
}
@@ -486,13 +487,11 @@
die('Usage: jmuc invite {jid} [muc] [-a account]')
unless $muc && $invite_jid;
- my $x = new XML::Stream::Node('x');
- $x->put_attrib( xmlns => 'http://jabber.org/protocol/muc#user' );
- $x->add_child('invite')->put_attrib( to => $invite_jid );
-
- my $message = new Net::Jabber::Message;
+ my $message = Net::Jabber::Message->new();
$message->SetTo($muc);
- $message->AddX($x);
+ my $x = $message->NewChild('http://jabber.org/protocol/muc#user');
+ $x->AddInvite();
+ $x->GetInvite()->SetTo($invite_jid);
$connections->{$jid}->{client}->Send($message);
queue_admin_msg("$jid has invited $invite_jid to $muc.");
}