Changeset 30c735c


Ignore:
Timestamp:
Jan 11, 2007, 5:29:14 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:
31cf416
Parents:
004caa5
git-author:
Nelson Elhage <nelhage@mit.edu> (01/11/07 16:18:17)
git-committer:
Nelson Elhage <nelhage@mit.edu> (01/11/07 17:29:14)
Message:
Adding a BarnOwl::Jabber::Connection class where we can add extensions
to Net::Jabber that we need.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perl/modules/jabber.pl

    r60986b2 r30c735c  
    2828################################################################################
    2929################################################################################
     30package BarnOwl::Jabber::Connection;
     31
     32use base qw(Net::Jabber::Client);
     33
     34sub new {
     35    my $class = shift;
     36
     37    my %args = ();
     38    if(BarnOwl::getvar('debug') eq 'on') {
     39        $args{debuglevel} = 1;
     40        $args{debugfile} = 'jabber.log';
     41    }
     42    my $self = $class->SUPER::new(%args);
     43    return $self
     44}
     45
     46################################################################################
     47################################################################################
    3048package BarnOwl::Jabber::ConnectionManager;
    3149sub new {
     
    3856    my $jidStr = shift;
    3957
    40     my %args = ();
    41     if(BarnOwl::getvar('debug') eq 'on') {
    42         $args{debuglevel} = 1;
    43         $args{debugfile} = 'jabber.log';
    44     }
    45     my $client = Net::Jabber::Client->new(%args);
     58    my $client = BarnOwl::Jabber::Connection->new;
    4659
    4760    $self->{Client}->{$jidStr} = $client;
     
    120133################################################################################
    121134
    122 package owl_jabber;
     135package BarnOwl::Jabber;
    123136
    124137our $conn = new BarnOwl::Jabber::ConnectionManager unless $conn;;
Note: See TracChangeset for help on using the changeset viewer.