Ignore:
File:
1 edited

Legend:

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

    r892568b rf032974  
    581581      or die("Usage: jmuc join MUC [-p password] [-a account]");
    582582
    583     die("Error: Must specify a fully-qualified MUC name (e.g. barnowl\@conference.mit.edu)\n")
    584         unless $muc =~ /@/;
    585583    $muc = Net::Jabber::JID->new($muc);
    586584    $jid = Net::Jabber::JID->new($jid);
     
    588586
    589587    $conn->getConnectionFromJID($jid)->MUCJoin(JID      => $muc,
    590                                                Password => $password,
    591                                                History  => {
    592                                                    MaxChars => 0
    593                                                   });
     588                                                  Password => $password,
     589                                                  History  => {
     590                                                      MaxChars => 0
     591                                                     });
    594592    return;
    595593}
     
    601599    die("Usage: jmuc part MUC [-a account]") unless $muc;
    602600
    603     if($conn->getConnectionFromJID($jid)->MUCLeave(JID => $muc)) {
    604         queue_admin_msg("$jid has left $muc.");
    605     } else {
    606         die("Error: Not joined to $muc");
    607     }
     601    $conn->getConnectionFromJID($jid)->MUCLeave(JID => $muc);
     602    queue_admin_msg("$jid has left $muc.");
    608603}
    609604
     
    644639    my $m = shift;
    645640    my @jids = $m->Presence();
    646 
    647     my $presence = "JIDs present in " . $m->BaseJID;
    648     if($m->Anonymous) {
    649         $presence .= " [anonymous MUC]";
    650     }
    651     $presence .= "\n\t";
    652     $presence .= join("\n\t", map {pp_jid($m, $_);} @jids) . "\n";
    653     return $presence;
    654 }
    655 
    656 sub pp_jid {
    657     my ($m, $jid) = @_;
    658     my $nick = $jid->GetResource;
    659     my $full = $m->GetFullJID($jid);
    660     if($full && $full ne $nick) {
    661         return "$nick ($full)";
    662     } else {
    663         return "$nick";
    664     }
     641    return "JIDs present in " . $m->BaseJID . "\n\t"
     642      . join("\n\t", map {$_->GetResource}@jids) . "\n";
    665643}
    666644
     
    926904                              sid => $sid } );
    927905    $jhash{type} = 'admin';
    928    
    929906    BarnOwl::queue_message( BarnOwl::Message->new(%jhash) );
    930907}
     
    11571134    }
    11581135    elsif ( $jtype eq 'normal' ) {
    1159         $props{replycmd}  = "";
     1136        $props{replycmd}  = undef;
    11601137        $props{private} = 1;
    11611138    }
    11621139    elsif ( $jtype eq 'headline' ) {
    1163         $props{replycmd} = "";
     1140        $props{replycmd} = undef;
    11641141    }
    11651142    elsif ( $jtype eq 'error' ) {
    1166         $props{replycmd} = "";
     1143        $props{replycmd} = undef;
    11671144        $props{body}     = "Error "
    11681145          . $props{error_code}
Note: See TracChangeset for help on using the changeset viewer.