- Timestamp:
- Jan 24, 2007, 5:24:09 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:
- 45d9eb0
- Parents:
- 63bbef4
- git-author:
- Nelson Elhage <nelhage@mit.edu> (01/24/07 17:22:34)
- git-committer:
- Nelson Elhage <nelhage@mit.edu> (01/24/07 17:24:09)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
perl/modules/jabber.pl
r63bbef4 r989fae0 583 583 } 584 584 585 ($jwrite_from, $jwrite_to, $jwrite_type)= guess_jwrite($from, $to);585 my @candidates = guess_jwrite($from, $to); 586 586 587 unless( $jwrite_to) {587 unless(scalar @candidates) { 588 588 die("Unable to resolve JID $to"); 589 589 } 590 590 591 unless($jwrite_from) { 591 @candidates = grep {defined $_->[0]} @candidates; 592 593 unless(scalar @candidates) { 592 594 if(!$from) { 593 595 die("You must specify an account with -a"); … … 596 598 } 597 599 } 600 601 602 ($jwrite_from, $jwrite_to, $jwrite_type) = @{$candidates[0]}; 598 603 599 604 $vars{jwrite} = { … … 606 611 }; 607 612 608 BarnOwl::message( 609 "Type your message below. End with a dot on a line by itself. ^C will quit." 610 ); 613 if(scalar @candidates > 1) { 614 BarnOwl::message( 615 "Warning: Guessing account and/or destination JID" 616 ); 617 } else { 618 BarnOwl::message( 619 "Type your message below. End with a dot on a line by itself. ^C will quit." 620 ); 621 } 622 611 623 my $cmd = "jwrite $jwrite_to -a $jwrite_from"; 612 624 $cmd .= " -t $jwrite_thread" if $jwrite_thread; … … 1330 1342 my ($from, $to) = (@_); 1331 1343 my ($from_jid, $to_jid); 1344 my @matches; 1332 1345 if($from) { 1333 1346 $from_jid = resolveConnectedJID($from); 1334 1347 die("Unable to resolve account $from") unless $from_jid; 1335 1348 $to_jid = resolveDestJID($to, $from_jid); 1349 push @matches, [$from_jid, $to_jid]; 1336 1350 } else { 1337 for my $f ($conn->getJ ids) {1351 for my $f ($conn->getJIDs) { 1338 1352 $to_jid = resolveDestJID($to, $f); 1339 1353 if(defined($to_jid)) { 1340 $from_jid = $f;1354 push @matches, [$f, $to_jid]; 1341 1355 } 1342 1356 } 1343 $to_jid = $to if $to =~ /@/; 1344 die("Unable to resolve JID $to") unless $to_jid; 1345 } 1346 1347 my $type = resolveType($to_jid, $from_jid); 1348 return ($from_jid, $to_jid, $type); 1357 if($to =~ /@/) { 1358 push @matches, [$_, $to] 1359 for ($conn->getJIDs); 1360 } 1361 } 1362 1363 for my $m (@matches) { 1364 my $type = resolveType($m->[1], $m->[0]); 1365 push @$m, $type; 1366 } 1367 1368 return @matches; 1349 1369 } 1350 1370
Note: See TracChangeset
for help on using the changeset viewer.