Changeset 8ff511d for perl/modules/Jabber
- Timestamp:
- Oct 17, 2009, 12:35:12 AM (15 years ago)
- Branches:
- master, release-1.10, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 6a9fbca
- Parents:
- ec70b79
- git-author:
- Alejandro R. Sedeño <asedeno@mit.edu> (10/16/09 23:25:57)
- git-committer:
- Alejandro R. Sedeño <asedeno@mit.edu> (10/17/09 00:35:12)
- Location:
- perl/modules/Jabber/lib/BarnOwl/Module
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
perl/modules/Jabber/lib/BarnOwl/Module/Jabber.pm
rec70b79 r8ff511d 352 352 sub cmd_login { 353 353 my $cmd = shift; 354 my $jidStr = shift; 354 355 my $jid = new Net::Jabber::JID; 355 $jid->SetJID( shift);356 $jid->SetJID($jidStr); 356 357 my $password = ''; 357 358 $password = shift if @_; … … 359 360 my $uid = $jid->GetUserID(); 360 361 my $componentname = $jid->GetServer(); 361 my $resource = $jid->GetResource() || 'owl'; 362 my $resource = $jid->GetResource(); 363 364 if ($resource eq '') { 365 my $cjidStr = $conn->baseJIDExists($jidStr); 366 if ($cjidStr) { 367 BarnOwl::error("Already logged in as $cjidStr."); 368 return; 369 } 370 } 371 372 $resource ||= 'owl'; 362 373 $jid->SetResource($resource); 363 my$jidStr = $jid->GetJID('full');374 $jidStr = $jid->GetJID('full'); 364 375 365 376 if ( !$uid || !$componentname ) { -
perl/modules/Jabber/lib/BarnOwl/Module/Jabber/ConnectionManager.pm
r6b580b0 r8ff511d 73 73 } 74 74 75 sub baseJIDExists { 76 my $self = shift; 77 my $jidStr = shift; 78 my $jid = new Net::Jabber::JID; 79 $jid->SetJID($jidStr); 80 my $baseJID = $jid->GetJID('base'); 81 82 foreach my $cjidStr ( keys %{ $self } ) { 83 my $cJID = new Net::Jabber::JID; 84 $cJID->SetJID($cjidStr); 85 return $cjidStr if ($cJID->GetJID('base') eq $baseJID); 86 } 87 return 0; 88 } 89 75 90 sub sidExists { 76 91 my $self = shift;
Note: See TracChangeset
for help on using the changeset viewer.