Ignore:
Timestamp:
Oct 17, 2009, 12:35:12 AM (13 years ago)
Author:
Alejandro R. Sedeño <asedeno@mit.edu>
Branches:
master, 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)
Message:
Tweak jabberlogin.

* Disallow logging into the same jabber account twice unless you are
  explicitly specifying a resource.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perl/modules/Jabber/lib/BarnOwl/Module/Jabber.pm

    rec70b79 r8ff511d  
    352352sub cmd_login {
    353353    my $cmd = shift;
     354    my $jidStr = shift;
    354355    my $jid = new Net::Jabber::JID;
    355     $jid->SetJID(shift);
     356    $jid->SetJID($jidStr);
    356357    my $password = '';
    357358    $password = shift if @_;
     
    359360    my $uid           = $jid->GetUserID();
    360361    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';
    362373    $jid->SetResource($resource);
    363     my $jidStr = $jid->GetJID('full');
     374    $jidStr = $jid->GetJID('full');
    364375
    365376    if ( !$uid || !$componentname ) {
Note: See TracChangeset for help on using the changeset viewer.