Changeset ebfcc87 for perl/modules/Jabber/lib
- Timestamp:
- May 19, 2010, 12:29:51 PM (14 years ago)
- Branches:
- master, release-1.10, release-1.7, release-1.8, release-1.9
- Children:
- 8278543
- Parents:
- bacf674
- git-author:
- Nelson Elhage <nelhage@mit.edu> (05/19/10 12:28:23)
- git-committer:
- Nelson Elhage <nelhage@mit.edu> (05/19/10 12:29:51)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
perl/modules/Jabber/lib/BarnOwl/Module/Jabber.pm
rbacf674 rebfcc87 377 377 my $cjidStr = $conn->baseJIDExists($jidStr); 378 378 if ($cjidStr) { 379 BarnOwl::error("Already logged in as $cjidStr."); 380 return; 379 die("Already logged in as $cjidStr.\n"); 381 380 } 382 381 } … … 387 386 388 387 if ( !$uid || !$componentname ) { 389 BarnOwl::error("usage: $cmd JID"); 390 return; 388 die("usage: $cmd JID\n"); 391 389 } 392 390 393 391 if ( $conn->jidActive($jidStr) ) { 394 BarnOwl::error("Already logged in as $jidStr."); 395 return; 392 die("Already logged in as $jidStr.\n"); 396 393 } elsif ($conn->jidExists($jidStr)) { 397 394 return $conn->tryReconnect($jidStr, 1); … … 526 523 sub cmd_jlist { 527 524 if ( !( scalar $conn->getJIDs() ) ) { 528 BarnOwl::error("You are not logged in to Jabber."); 529 return; 525 die("You are not logged in to Jabber.\n"); 530 526 } 531 527 BarnOwl::popless_ztext( onGetBuddyList() ); … … 534 530 sub cmd_jwrite { 535 531 if ( !$conn->connected() ) { 536 BarnOwl::error("You are not logged in to Jabber."); 537 return; 532 die("You are not logged in to Jabber.\n"); 538 533 } 539 534 … … 559 554 560 555 if ( scalar @ARGV != 1 ) { 561 BarnOwl::error( 562 "Usage: jwrite <jid> [-t <thread>] [-s <subject>] [-a <account>]"); 563 return; 556 die("Usage: jwrite <jid> [-t <thread>] [-s <subject>] [-a <account>]\n"); 564 557 } 565 558 else { … … 570 563 571 564 unless(scalar @candidates) { 572 die("Unable to resolve JID $to ");565 die("Unable to resolve JID $to\n"); 573 566 } 574 567 … … 577 570 unless(scalar @candidates) { 578 571 if(!$from) { 579 die("You must specify an account with -a ");572 die("You must specify an account with -a\n"); 580 573 } else { 581 die("Unable to resolve account $from ");574 die("Unable to resolve account $from\n"); 582 575 } 583 576 } … … 631 624 my $func = $jmuc_commands{$cmd}; 632 625 if ( !$func ) { 633 BarnOwl::error("jmuc: Unknown command: $cmd"); 634 return; 626 die("jmuc: Unknown command: $cmd\n"); 635 627 } 636 628 … … 654 646 } 655 647 else { 656 BarnOwl::error('You must specify an account with -a <jid>');648 die("You must specify an account with -a <jid>\n"); 657 649 } 658 650 return $func->( $jid, $muc, @ARGV ); … … 667 659 668 660 $muc = shift @ARGV 669 or die("Usage: jmuc join <muc> [-p <password>] [-a <account>] ");661 or die("Usage: jmuc join <muc> [-p <password>] [-a <account>]\n"); 670 662 671 663 die("Error: Must specify a fully-qualified MUC name (e.g. barnowl\@conference.mit.edu)\n") … … 688 680 689 681 $muc = shift @args if scalar @args; 690 die("Usage: jmuc part [<muc>] [-a <account>] ") unless $muc;682 die("Usage: jmuc part [<muc>] [-a <account>]\n") unless $muc; 691 683 692 684 if($conn->getConnectionFromJID($jid)->MUCLeave(JID => $muc)) { 693 685 queue_admin_msg("$jid has left $muc."); 694 686 } else { 695 die("Error: Not joined to $muc ");687 die("Error: Not joined to $muc\n"); 696 688 } 697 689 } … … 703 695 $muc = shift @args if scalar @args; 704 696 705 die( 'Usage: jmuc invite <jid> [<muc>] [-a <account>]')697 die("Usage: jmuc invite <jid> [<muc>] [-a <account>]\n") 706 698 unless $muc && $invite_jid; 707 699 … … 718 710 my ( $jid, $muc, @args ) = @_; 719 711 $muc = shift @args if scalar @args; 720 die("Usage: jmuc configure [<muc>] ") unless $muc;712 die("Usage: jmuc configure [<muc>]\n") unless $muc; 721 713 my $iq = Net::Jabber::IQ->new(); 722 714 $iq->SetTo($muc); … … 759 751 760 752 $muc = shift @args if scalar @args; 761 die("Usage: jmuc presence [<muc>] ") unless $muc;753 die("Usage: jmuc presence [<muc>]\n") unless $muc; 762 754 763 755 if ($muc eq '-a') { … … 774 766 else { 775 767 my $m = $conn->getConnectionFromJID($jid)->FindMUC(jid => $muc); 776 die("No such muc: $muc ") unless $m;768 die("No such muc: $muc\n") unless $m; 777 769 BarnOwl::popless_ztext(jmuc_presence_single($m)); 778 770 } … … 801 793 my $func = $jroster_commands{$cmd}; 802 794 if ( !$func ) { 803 BarnOwl::error("jroster: Unknown command: $cmd"); 804 return; 795 die("jroster: Unknown command: $cmd\n"); 805 796 } 806 797 … … 825 816 } 826 817 else { 827 BarnOwl::error('You must specify an account with -a <jid>');818 die("You must specify an account with -a <jid>\n"); 828 819 } 829 820 return $func->( $jid, $name, \@groups, $purgeGroups, @ARGV ); … … 849 840 } 850 841 else { 851 BarnOwl::error('You must specify an account with -a <jid>');842 die("You must specify an account with -a <jid>\n"); 852 843 } 853 844 … … 1331 1322 return $givenJIDStr if ($conn->jidExists($givenJIDStr) ); 1332 1323 return resolveConnectedJID($givenJID->GetJID('base')) if $loose; 1333 die("Invalid account: $givenJIDStr ");1324 die("Invalid account: $givenJIDStr\n"); 1334 1325 } 1335 1326 … … 1384 1375 # Not one of ours. 1385 1376 else { 1386 die("Invalid account: $givenJIDStr ");1377 die("Invalid account: $givenJIDStr\n"); 1387 1378 } 1388 1379 … … 1430 1421 if($from) { 1431 1422 $from_jid = resolveConnectedJID($from, 1); 1432 die("Unable to resolve account $from ") unless $from_jid;1423 die("Unable to resolve account $from\n") unless $from_jid; 1433 1424 $to_jid = resolveDestJID($to, $from_jid); 1434 1425 push @matches, [$from_jid, $to_jid] if $to_jid;
Note: See TracChangeset
for help on using the changeset viewer.