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