Changeset 7cdf756
- Timestamp:
- Jan 25, 2007, 3:46:26 PM (18 years ago)
- Branches:
- master, barnowl_perlaim, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- c25a20f
- Parents:
- 71e33ca
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
perl/modules/jabber.pl
r71e33ca r7cdf756 373 373 description => "jmuc sends jabber commands related to muc.\n\n" 374 374 . "The following commands are available\n\n" 375 . "join MUCJoin a muc.\n\n"376 . "part MUCPart a muc.\n"375 . "join <muc> Join a muc.\n\n" 376 . "part <muc> Part a muc.\n" 377 377 . " The muc is taken from the current message if not supplied.\n\n" 378 . "invite JID MUC\n"379 . " Invite JID to MUC.\n"378 . "invite <jid> <muc>\n" 379 . " Invite <jid> to <muc>.\n" 380 380 . " The muc is taken from the current message if not supplied.\n\n" 381 . "configure MUC\n" 382 . " Configure [muc].\n" 383 . " Necessary to initalize a new MUC\n" 384 . " At present, only the default configuration is supported.", 381 . "configure <muc>\n" 382 . " Configures a MUC.\n" 383 . " Necessary to initalize a new MUC.\n" 384 . " At present, only the default configuration is supported.\n" 385 . " The muc is taken from the current message if not supplied.\n\n" 386 . "presence <muc>\n" 387 . " Shows the roster for <muc>.\n" 388 . " The muc is taken from the current message if not supplied.\n\n" 389 . "presence -a\n" 390 . " Shows rosters for all MUCs you're participating in.\n\n", 385 391 usage => "jmuc COMMAND ARGS" 386 392 } … … 752 758 } 753 759 760 sub jmuc_presence_single { 761 my $m = shift; 762 my @jids = $m->Presence(); 763 return "JIDs present in " . $m->BaseJID . "\n\t" 764 . join("\n\t", map {$_->GetResource}@jids) . "\n"; 765 } 766 754 767 sub jmuc_presence { 755 768 my ( $jid, $muc, @args ) = @_; … … 758 771 die("Usage: jmuc presence MUC") unless $muc; 759 772 760 my $m = $conn->getConnectionFromJID($jid)->FindMUC(jid => $muc); 761 die("No such muc: $muc") unless $m; 762 763 my @jids = $m->Presence(); 764 BarnOwl::popless_ztext("JIDs present in " . $m->BaseJID . "\n\t" . 765 join("\n\t", map {$_->GetResource}@jids) . "\n"); 773 if ($muc eq '-a') { 774 my $str = ""; 775 foreach my $jid ($conn->getJIDs()) { 776 $str .= boldify("Conferences for $jid:\n"); 777 my $connection = $conn->getConnectionFromJID($jid); 778 foreach my $muc ($connection->MUCs) { 779 $str .= jmuc_presence_single($muc)."\n"; 780 } 781 } 782 BarnOwl::popless_ztext($str); 783 } 784 else { 785 my $m = $conn->getConnectionFromJID($jid)->FindMUC(jid => $muc); 786 die("No such muc: $muc") unless $m; 787 BarnOwl::popless_ztext(jmuc_presence_single($m)); 788 } 766 789 } 767 790
Note: See TracChangeset
for help on using the changeset viewer.