Changeset 60986b2


Ignore:
Timestamp:
Jan 11, 2007, 4:02:37 PM (14 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, barnowl_perlaim, debian, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
004caa5
Parents:
12e5f17
git-author:
Nelson Elhage <nelhage@mit.edu> (01/11/07 15:59:46)
git-committer:
Nelson Elhage <nelhage@mit.edu> (01/11/07 16:02:37)
Message:
owl_jabber:: -> BarnOwl::Jabber::
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perl/modules/jabber.pl

    r5551208 r60986b2  
    11# -*- mode: cperl; cperl-indent-level: 4; indent-tabs-mode: nil -*-
    2 package owl_jabber;
     2package BarnOwl::Jabber;
    33use warnings;
    44use strict;
     
    2222# Implementing formatting and logging callbacks for C
    2323# Appropriate callbacks for presence subscription messages.
    24 #  * Current behavior is auto-accept (default for Net::Jabber)
    2524#
    2625################################################################################
     
    2928################################################################################
    3029################################################################################
    31 package owl_jabber::ConnectionManager;
     30package BarnOwl::Jabber::ConnectionManager;
    3231sub new {
    3332    my $class = shift;
     
    123122package owl_jabber;
    124123
    125 our $conn = new owl_jabber::ConnectionManager unless $conn;;
     124our $conn = new BarnOwl::Jabber::ConnectionManager unless $conn;;
    126125our %vars;
    127126
     
    129128    if ( *BarnOwl::queue_message{CODE} ) {
    130129        register_owl_commands();
    131         push @::onMainLoop,     sub { owl_jabber::onMainLoop(@_) };
    132         push @::onGetBuddyList, sub { owl_jabber::onGetBuddyList(@_) };
     130        push @::onMainLoop,     sub { BarnOwl::Jabber::onMainLoop(@_) };
     131        push @::onGetBuddyList, sub { BarnOwl::Jabber::onGetBuddyList(@_) };
    133132    } else {
    134133        # Our owl doesn't support queue_message. Unfortunately, this
     
    138137}
    139138
    140 push @::onStartSubs, sub { owl_jabber::onStart(@_) };
     139push @::onStartSubs, sub { BarnOwl::Jabber::onStart(@_) };
    141140
    142141sub onMainLoop {
     
    329328        #XXX Todo: Add more callbacks.
    330329        # * MUC presence handlers
     330        # We use the anonymous subrefs in order to have the correct behavior
     331        # when we reload
    331332        $client->SetMessageCallBacks(
    332             chat      => sub { owl_jabber::process_incoming_chat_message(@_) },
    333             error     => sub { owl_jabber::process_incoming_error_message(@_) },
    334             groupchat => sub { owl_jabber::process_incoming_groupchat_message(@_) },
    335             headline  => sub { owl_jabber::process_incoming_headline_message(@_) },
    336             normal    => sub { owl_jabber::process_incoming_normal_message(@_) }
     333            chat      => sub { BarnOwl::Jabber::process_incoming_chat_message(@_) },
     334            error     => sub { BarnOwl::Jabber::process_incoming_error_message(@_) },
     335            groupchat => sub { BarnOwl::Jabber::process_incoming_groupchat_message(@_) },
     336            headline  => sub { BarnOwl::Jabber::process_incoming_headline_message(@_) },
     337            normal    => sub { BarnOwl::Jabber::process_incoming_normal_message(@_) }
    337338        );
    338339        $client->SetPresenceCallBacks(
    339 #            available    => sub { owl_jabber::process_presence_available(@_) },
    340 #            unavailable  => sub { owl_jabber::process_presence_available(@_) },
    341             subscribe    => sub { owl_jabber::process_presence_subscribe(@_) },
    342             subscribed   => sub { owl_jabber::process_presence_subscribed(@_) },
    343             unsubscribe  => sub { owl_jabber::process_presence_unsubscribe(@_) },
    344             unsubscribed => sub { owl_jabber::process_presence_unsubscribed(@_) },
    345             error        => sub { owl_jabber::process_presence_error(@_) });
     340            available    => sub { BarnOwl::Jabber::process_presence_available(@_) },
     341#            unavailable  => sub { BarnOwl::Jabber::process_presence_available(@_) },
     342            subscribe    => sub { BarnOwl::Jabber::process_presence_subscribe(@_) },
     343            subscribed   => sub { BarnOwl::Jabber::process_presence_subscribed(@_) },
     344            unsubscribe  => sub { BarnOwl::Jabber::process_presence_unsubscribe(@_) },
     345            unsubscribed => sub { BarnOwl::Jabber::process_presence_unsubscribed(@_) },
     346            error        => sub { BarnOwl::Jabber::process_presence_error(@_) });
    346347
    347348        my $status = $client->Connect( %{ $vars{jlogin_connhash} } );
     
    544545
    545546    $muc = shift @ARGV
    546       or die("Usage: jmuc join {muc} [-p password] [-a account]");
     547      or die("Usage: jmuc join MUC [-p password] [-a account]");
    547548
    548549    my $presence = new Net::Jabber::Presence;
     
    561562
    562563    $muc = shift @args if scalar @args;
    563     die("Usage: jmuc part {muc} [-a account]") unless $muc;
     564    die("Usage: jmuc part MUC [-a account]") unless $muc;
    564565
    565566    $conn->getConnectionFromJidStr($jid)->PresenceSend( to => $muc, type => 'unavailable' );
     
    573574    $muc = shift @args if scalar @args;
    574575
    575     die('Usage: jmuc invite {jid} [muc] [-a account]')
     576    die('Usage: jmuc invite JID [muc] [-a account]')
    576577      unless $muc && $invite_jid;
    577578
Note: See TracChangeset for help on using the changeset viewer.