- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
perl/modules/Jabber/lib/BarnOwl/Module/Jabber.pm
r892568b rf032974 581 581 or die("Usage: jmuc join MUC [-p password] [-a account]"); 582 582 583 die("Error: Must specify a fully-qualified MUC name (e.g. barnowl\@conference.mit.edu)\n")584 unless $muc =~ /@/;585 583 $muc = Net::Jabber::JID->new($muc); 586 584 $jid = Net::Jabber::JID->new($jid); … … 588 586 589 587 $conn->getConnectionFromJID($jid)->MUCJoin(JID => $muc, 590 Password => $password,591 History => {592 MaxChars => 0593 });588 Password => $password, 589 History => { 590 MaxChars => 0 591 }); 594 592 return; 595 593 } … … 601 599 die("Usage: jmuc part MUC [-a account]") unless $muc; 602 600 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."); 608 603 } 609 604 … … 644 639 my $m = shift; 645 640 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"; 665 643 } 666 644 … … 926 904 sid => $sid } ); 927 905 $jhash{type} = 'admin'; 928 929 906 BarnOwl::queue_message( BarnOwl::Message->new(%jhash) ); 930 907 } … … 1157 1134 } 1158 1135 elsif ( $jtype eq 'normal' ) { 1159 $props{replycmd} = "";1136 $props{replycmd} = undef; 1160 1137 $props{private} = 1; 1161 1138 } 1162 1139 elsif ( $jtype eq 'headline' ) { 1163 $props{replycmd} = "";1140 $props{replycmd} = undef; 1164 1141 } 1165 1142 elsif ( $jtype eq 'error' ) { 1166 $props{replycmd} = "";1143 $props{replycmd} = undef; 1167 1144 $props{body} = "Error " 1168 1145 . $props{error_code}
Note: See TracChangeset
for help on using the changeset viewer.