Changeset 2439838


Ignore:
Timestamp:
Oct 19, 2009, 7:30:17 PM (12 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
release-1.4
Children:
a09ea91
Parents:
eadcb40
git-author:
Cathy R Zhang <zhangc@mit.edu> (10/17/09 00:21:22)
git-committer:
Nelson Elhage <nelhage@mit.edu> (10/19/09 19:30:17)
Message:
Updated Jabber documentation for consistency.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perl/modules/Jabber/lib/BarnOwl/Module/Jabber.pm

    r26cde20 r2439838  
    3737            BarnOwl::error("You are using IO::Socket:SSL 0.97, which \n" .
    3838                           "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" .
    4040                           "IO::Socket::SSL from CPAN. \n");
    4141            die("Not loading Jabber.par\n");
     
    206206    my $roster = $conn->getRosterFromJID($jid);
    207207    if ($roster) {
    208         $blist .= "\n" . BarnOwl::Style::boldify("Jabber Roster for $jid\n");
     208        $blist .= "\n" . BarnOwl::Style::boldify("Jabber roster for $jid\n");
    209209
    210210        my @gTexts = ();
     
    258258        jabberlogin => \&cmd_login,
    259259        {
    260             summary => "Log into jabber",
    261             usage   => "jabberlogin JID [PASSWORD]"
     260            summary => "Log in to Jabber",
     261            usage   => "jabberlogin <jid> [<password>]"
    262262        }
    263263    );
    264264    BarnOwl::new_command(
    265265        jabberlogout => \&cmd_logout,
    266         { summary => "Log out of jabber" }
     266        {
     267            summary => "Log out of Jabber",
     268            usage   => "jabberlogout [<jid>]"
     269        }
    267270    );
    268271    BarnOwl::new_command(
     
    270273        {
    271274            summary => "Send a Jabber Message",
    272             usage   => "jwrite JID [-t thread] [-s subject]"
     275            usage   => "jwrite <jid> [-t <thread>] [-s <subject>]"
    273276        }
    274277    );
     
    291294        {
    292295            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"
    294297              . "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"
    299302              . "            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"
    302305              . "            Configures a MUC.\n"
    303306              . "            Necessary to initalize a new MUC.\n"
    304307              . "            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"
    307310              . "            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"
    309312              . "presence -a\n"
    310313              . "            Shows rosters for all MUCs you're participating in.\n\n",
    311             usage => "jmuc COMMAND ARGS"
     314            usage => "jmuc <command> [<args>]"
    312315        }
    313316    );
     
    315318        jroster => \&cmd_jroster,
    316319        {
    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"
    319322              . "The following commands are available\n\n"
    320323              . "sub <jid>     Subscribe to <jid>'s presence. (implicit add)\n\n"
     
    331334              . "              May be specified more than once, will not remove <jid> from any groups.\n\n"
    332335              . "-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"
    334337              . "-n <name>     Sets <name> as <jid>'s short name.\n\n"
    335338              . "Note: Unless -n is used, you can specify multiple <jid> arguments.\n",
    336             usage       => "jroster COMMAND ARGS"
     339            usage       => "jroster <command> <args>"
    337340        }
    338341    );
     
    392395    my $jidStr = $vars{jlogin_jid};
    393396    if ( !$jidStr && $vars{jlogin_havepass}) {
    394         BarnOwl::error("Got password but have no jid!");
     397        BarnOwl::error("Got password but have no JID!");
    395398    }
    396399    else
     
    421424        if ( !$status ) {
    422425            $conn->removeConnection($jidStr);
    423             BarnOwl::error("We failed to connect");
     426            BarnOwl::error("We failed to connect.");
    424427        } else {
    425428            my @result = $client->AuthSend( %{ $vars{jlogin_authhash} } );
     
    482485
    483486sub 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);
    485488    # Logged into multiple accounts
    486489    if ( $conn->connected() > 1 ) {
     
    547550        'account=s' => \$from,
    548551        '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");
    550553    $jwrite_type = 'groupchat' if $gc;
    551554
    552555    if ( scalar @ARGV != 1 ) {
    553556        BarnOwl::error(
    554             "Usage: jwrite JID [-t thread] [-s 'subject'] [-a account]");
     557            "Usage: jwrite <jid> [-t <thread>] [-s <subject>] [-a <account>]");
    555558        return;
    556559    }
     
    646649        }
    647650        else {
    648             BarnOwl::error('You must specify an account with -a {jid}');
     651            BarnOwl::error('You must specify an account with -a <jid>');
    649652        }
    650653        return $func->( $jid, $muc, @ARGV );
     
    659662
    660663    $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>]");
    662665
    663666    die("Error: Must specify a fully-qualified MUC name (e.g. barnowl\@conference.mit.edu)\n")
     
    680683
    681684    $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;
    683686
    684687    if($conn->getConnectionFromJID($jid)->MUCLeave(JID => $muc)) {
     
    695698    $muc = shift @args if scalar @args;
    696699
    697     die('Usage: jmuc invite JID [muc] [-a account]')
     700    die('Usage: jmuc invite <jid> [<muc>] [-a <account>]')
    698701      unless $muc && $invite_jid;
    699702
     
    710713    my ( $jid, $muc, @args ) = @_;
    711714    $muc = shift @args if scalar @args;
    712     die("Usage: jmuc configure [muc]") unless $muc;
     715    die("Usage: jmuc configure [<muc>]") unless $muc;
    713716    my $iq = Net::Jabber::IQ->new();
    714717    $iq->SetTo($muc);
     
    751754
    752755    $muc = shift @args if scalar @args;
    753     die("Usage: jmuc presence MUC") unless $muc;
     756    die("Usage: jmuc presence [<muc>]") unless $muc;
    754757
    755758    if ($muc eq '-a') {
     
    817820        }
    818821        else {
    819             BarnOwl::error('You must specify an account with -a {jid}');
     822            BarnOwl::error('You must specify an account with -a <jid>');
    820823        }
    821824        return $func->( $jid, $name, \@groups, $purgeGroups,  @ARGV );
     
    841844    }
    842845    else {
    843         BarnOwl::error('You must specify an account with -a {jid}');
     846        BarnOwl::error('You must specify an account with -a <jid>');
    844847    }
    845848
Note: See TracChangeset for help on using the changeset viewer.