Changeset 24398384d59218e8c0e50c2ee363d02423e18db9
- Timestamp:
- 10/19/09 19:30:17 (5 weeks ago)
- Author:
- Nelson Elhage <nelhage@mit.edu>
- git-author:
- Cathy R Zhang <zhangc@mit.edu> / 2009-10-17T00:21:22Z-0400
- Parents:
- eadcb4032ecb07811648d2038eae5730cb541126
- Children:
- a09ea91c90aa8546d125d4bdf549ab88f0eb4366
- git-committer:
- Nelson Elhage <nelhage@mit.edu> / 2009-10-19T19:30:17Z-0400
- Message:
-
Updated Jabber documentation for consistency.
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r26cde20
|
r2439838
|
|
| 37 | 37 | BarnOwl::error("You are using IO::Socket:SSL 0.97, which \n" . |
| 38 | 38 | "contains bugs causing it not to work with barnowl's\n" . |
| 39 | | "jabber support. We recommend updating to the latest\n" . |
| | 39 | "Jabber support. We recommend updating to the latest\n" . |
| 40 | 40 | "IO::Socket::SSL from CPAN. \n"); |
| 41 | 41 | die("Not loading Jabber.par\n"); |
| … |
… |
|
| 206 | 206 | my $roster = $conn->getRosterFromJID($jid); |
| 207 | 207 | if ($roster) { |
| 208 | | $blist .= "\n" . BarnOwl::Style::boldify("Jabber Roster for $jid\n"); |
| | 208 | $blist .= "\n" . BarnOwl::Style::boldify("Jabber roster for $jid\n"); |
| 209 | 209 | |
| 210 | 210 | my @gTexts = (); |
| … |
… |
|
| 258 | 258 | jabberlogin => \&cmd_login, |
| 259 | 259 | { |
| 260 | | summary => "Log into jabber", |
| 261 | | usage => "jabberlogin JID [PASSWORD]" |
| | 260 | summary => "Log in to Jabber", |
| | 261 | usage => "jabberlogin <jid> [<password>]" |
| 262 | 262 | } |
| 263 | 263 | ); |
| 264 | 264 | BarnOwl::new_command( |
| 265 | 265 | jabberlogout => \&cmd_logout, |
| 266 | | { summary => "Log out of jabber" } |
| | 266 | { |
| | 267 | summary => "Log out of Jabber", |
| | 268 | usage => "jabberlogout [<jid>]" |
| | 269 | } |
| 267 | 270 | ); |
| 268 | 271 | BarnOwl::new_command( |
| … |
… |
|
| 270 | 273 | { |
| 271 | 274 | summary => "Send a Jabber Message", |
| 272 | | usage => "jwrite JID [-t thread] [-s subject]" |
| | 275 | usage => "jwrite <jid> [-t <thread>] [-s <subject>]" |
| 273 | 276 | } |
| 274 | 277 | ); |
| … |
… |
|
| 291 | 294 | { |
| 292 | 295 | summary => "Jabber MUC related commands.", |
| 293 | | description => "jmuc sends jabber commands related to muc.\n\n" |
| | 296 | description => "jmuc sends Jabber commands related to MUC.\n\n" |
| 294 | 297 | . "The following commands are available\n\n" |
| 295 | | . "join <muc> Join a muc.\n\n" |
| 296 | | . "part <muc> Part a muc.\n" |
| 297 | | . " The muc is taken from the current message if not supplied.\n\n" |
| 298 | | . "invite <jid> <muc>\n" |
| | 298 | . "join <muc> Join a MUC.\n\n" |
| | 299 | . "part <muc> Part a MUC.\n" |
| | 300 | . " The MUC is taken from the current message if not supplied.\n\n" |
| | 301 | . "invite <jid> [<muc>]\n" |
| 299 | 302 | . " Invite <jid> to <muc>.\n" |
| 300 | | . " The muc is taken from the current message if not supplied.\n\n" |
| 301 | | . "configure <muc>\n" |
| | 303 | . " The MUC is taken from the current message if not supplied.\n\n" |
| | 304 | . "configure [<muc>]\n" |
| 302 | 305 | . " Configures a MUC.\n" |
| 303 | 306 | . " Necessary to initalize a new MUC.\n" |
| 304 | 307 | . " At present, only the default configuration is supported.\n" |
| 305 | | . " The muc is taken from the current message if not supplied.\n\n" |
| 306 | | . "presence <muc>\n" |
| | 308 | . " The MUC is taken from the current message if not supplied.\n\n" |
| | 309 | . "presence [<muc>]\n" |
| 307 | 310 | . " Shows the roster for <muc>.\n" |
| 308 | | . " The muc is taken from the current message if not supplied.\n\n" |
| | 311 | . " The MUC is taken from the current message if not supplied.\n\n" |
| 309 | 312 | . "presence -a\n" |
| 310 | 313 | . " Shows rosters for all MUCs you're participating in.\n\n", |
| 311 | | usage => "jmuc COMMAND ARGS" |
| | 314 | usage => "jmuc <command> [<args>]" |
| 312 | 315 | } |
| 313 | 316 | ); |
| … |
… |
|
| 315 | 318 | jroster => \&cmd_jroster, |
| 316 | 319 | { |
| 317 | | summary => "Jabber Roster related commands.", |
| 318 | | description => "jroster sends jabber commands related to rosters.\n\n" |
| | 320 | summary => "Jabber roster related commands.", |
| | 321 | description => "jroster sends Jabber commands related to rosters.\n\n" |
| 319 | 322 | . "The following commands are available\n\n" |
| 320 | 323 | . "sub <jid> Subscribe to <jid>'s presence. (implicit add)\n\n" |
| … |
… |
|
| 331 | 334 | . " May be specified more than once, will not remove <jid> from any groups.\n\n" |
| 332 | 335 | . "-p Purge. Removes <jid> from all groups.\n" |
| 333 | | . " May be combined with -g completely alter <jid>'s groups.\n\n" |
| | 336 | . " May be combined with -g.\n\n" |
| 334 | 337 | . "-n <name> Sets <name> as <jid>'s short name.\n\n" |
| 335 | 338 | . "Note: Unless -n is used, you can specify multiple <jid> arguments.\n", |
| 336 | | usage => "jroster COMMAND ARGS" |
| | 339 | usage => "jroster <command> <args>" |
| 337 | 340 | } |
| 338 | 341 | ); |
| … |
… |
|
| 392 | 395 | my $jidStr = $vars{jlogin_jid}; |
| 393 | 396 | if ( !$jidStr && $vars{jlogin_havepass}) { |
| 394 | | BarnOwl::error("Got password but have no jid!"); |
| | 397 | BarnOwl::error("Got password but have no JID!"); |
| 395 | 398 | } |
| 396 | 399 | else |
| … |
… |
|
| 421 | 424 | if ( !$status ) { |
| 422 | 425 | $conn->removeConnection($jidStr); |
| 423 | | BarnOwl::error("We failed to connect"); |
| | 426 | BarnOwl::error("We failed to connect."); |
| 424 | 427 | } else { |
| 425 | 428 | my @result = $client->AuthSend( %{ $vars{jlogin_authhash} } ); |
| … |
… |
|
| 482 | 485 | |
| 483 | 486 | sub cmd_logout { |
| 484 | | return "You are not logged into jabber." unless ($conn->connected() > 0); |
| | 487 | return "You are not logged into Jabber." unless ($conn->connected() > 0); |
| 485 | 488 | # Logged into multiple accounts |
| 486 | 489 | if ( $conn->connected() > 1 ) { |
| … |
… |
|
| 547 | 550 | 'account=s' => \$from, |
| 548 | 551 | 'id=s' => \$jwrite_sid, |
| 549 | | ) or die("Usage: jwrite JID [-t thread] [-s 'subject'] [-a account]\n"); |
| | 552 | ) or die("Usage: jwrite <jid> [-t <thread>] [-s <subject>] [-a <account>]\n"); |
| 550 | 553 | $jwrite_type = 'groupchat' if $gc; |
| 551 | 554 | |
| 552 | 555 | if ( scalar @ARGV != 1 ) { |
| 553 | 556 | BarnOwl::error( |
| 554 | | "Usage: jwrite JID [-t thread] [-s 'subject'] [-a account]"); |
| | 557 | "Usage: jwrite <jid> [-t <thread>] [-s <subject>] [-a <account>]"); |
| 555 | 558 | return; |
| 556 | 559 | } |
| … |
… |
|
| 646 | 649 | } |
| 647 | 650 | else { |
| 648 | | BarnOwl::error('You must specify an account with -a {jid}'); |
| | 651 | BarnOwl::error('You must specify an account with -a <jid>'); |
| 649 | 652 | } |
| 650 | 653 | return $func->( $jid, $muc, @ARGV ); |
| … |
… |
|
| 659 | 662 | |
| 660 | 663 | $muc = shift @ARGV |
| 661 | | or die("Usage: jmuc join MUC [-p password] [-a account]"); |
| | 664 | or die("Usage: jmuc join <muc> [-p <password>] [-a <account>]"); |
| 662 | 665 | |
| 663 | 666 | die("Error: Must specify a fully-qualified MUC name (e.g. barnowl\@conference.mit.edu)\n") |
| … |
… |
|
| 680 | 683 | |
| 681 | 684 | $muc = shift @args if scalar @args; |
| 682 | | die("Usage: jmuc part MUC [-a account]") unless $muc; |
| | 685 | die("Usage: jmuc part [<muc>] [-a <account>]") unless $muc; |
| 683 | 686 | |
| 684 | 687 | if($conn->getConnectionFromJID($jid)->MUCLeave(JID => $muc)) { |
| … |
… |
|
| 695 | 698 | $muc = shift @args if scalar @args; |
| 696 | 699 | |
| 697 | | die('Usage: jmuc invite JID [muc] [-a account]') |
| | 700 | die('Usage: jmuc invite <jid> [<muc>] [-a <account>]') |
| 698 | 701 | unless $muc && $invite_jid; |
| 699 | 702 | |
| … |
… |
|
| 710 | 713 | my ( $jid, $muc, @args ) = @_; |
| 711 | 714 | $muc = shift @args if scalar @args; |
| 712 | | die("Usage: jmuc configure [muc]") unless $muc; |
| | 715 | die("Usage: jmuc configure [<muc>]") unless $muc; |
| 713 | 716 | my $iq = Net::Jabber::IQ->new(); |
| 714 | 717 | $iq->SetTo($muc); |
| … |
… |
|
| 751 | 754 | |
| 752 | 755 | $muc = shift @args if scalar @args; |
| 753 | | die("Usage: jmuc presence MUC") unless $muc; |
| | 756 | die("Usage: jmuc presence [<muc>]") unless $muc; |
| 754 | 757 | |
| 755 | 758 | if ($muc eq '-a') { |
| … |
… |
|
| 817 | 820 | } |
| 818 | 821 | else { |
| 819 | | BarnOwl::error('You must specify an account with -a {jid}'); |
| | 822 | BarnOwl::error('You must specify an account with -a <jid>'); |
| 820 | 823 | } |
| 821 | 824 | return $func->( $jid, $name, \@groups, $purgeGroups, @ARGV ); |
| … |
… |
|
| 841 | 844 | } |
| 842 | 845 | else { |
| 843 | | BarnOwl::error('You must specify an account with -a {jid}'); |
| | 846 | BarnOwl::error('You must specify an account with -a <jid>'); |
| 844 | 847 | } |
| 845 | 848 | |