Changeset 9667006


Ignore:
Timestamp:
Jan 8, 2007, 4:17:31 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:
5f576e3
Parents:
6475057
git-author:
Nelson Elhage <nelhage@mit.edu> (01/08/07 14:34:12)
git-committer:
Nelson Elhage <nelhage@mit.edu> (01/08/07 16:17:31)
Message:
First pass at printing presence errors. This works with
conference.mit.edu, but only prints the error code for
conference.jabber.org right now.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perl/modules/jabber.pl

    rcb769bb r9667006  
    131131        push @::onMainLoop,     sub { owl_jabber::onMainLoop(@_) };
    132132        push @::onGetBuddyList, sub { owl_jabber::onGetBuddyList(@_) };
    133     }
    134     else {
     133    } else {
    135134        # Our owl doesn't support queue_message. Unfortunately, this
    136135        # means it probably *also* doesn't support owl::error. So just
     
    341340            subscribed   => sub { owl_jabber::process_presence_subscribed(@_) },
    342341            unsubscribe  => sub { owl_jabber::process_presence_unsubscribe(@_) },
    343             unsubscribed => sub { owl_jabber::process_presence_unsubscribed(@_) });
     342            unsubscribed => sub { owl_jabber::process_presence_unsubscribed(@_) },
     343            error        => sub { owl_jabber::process_presence_error(@_) });
    344344
    345345        my $status = $client->Connect( %{ $vars{jlogin_connhash} } );
     
    975975}
    976976
     977sub process_presence_error {
     978    my ( $sid, $p ) = @_;
     979    my $code = $p->GetErrorCode();
     980    my $error = $p->GetError();
     981    owl::error("Jabber: $code $error");
     982}
     983
    977984
    978985### Helper functions
     
    10701077    return '@b[' . $str . ']' if ( $str !~ /\]/ );
    10711078
    1072     my $txt = "\@b($str";
    1073     $txt =~ s/\)/\)\@b\[\)\]\@b\(/g;
    1074     return $txt . ')';
     1079    my $txt = "$str";
     1080    $txt =~ s{[)]}{)\@b[)]\@b(}g;
     1081    return '@b(' . $txt . ')';
    10751082}
    10761083
Note: See TracChangeset for help on using the changeset viewer.