Index: perl/modules/jabber.pl
===================================================================
--- perl/modules/jabber.pl	(revision 3ce5bdcf735a5b8f2bf8734b9f2700a29ef6c6e8)
+++ perl/modules/jabber.pl	(revision 63bbef48f7f1e835fa0e11ce4c4623ca6cdfc3fc)
@@ -155,5 +155,5 @@
 }
 
-sub getJids {
+sub getJIDs {
     my $self = shift;
     return keys %{ $self };
@@ -248,5 +248,5 @@
     }
 
-    foreach my $jid ( $conn->getJids() ) {
+    foreach my $jid ( $conn->getJIDs() ) {
         my $client = $conn->getConnectionFromJID($jid);
 
@@ -335,5 +335,5 @@
 sub onGetBuddyList {
     my $blist = "";
-    foreach my $jid ($conn->getJids()) {
+    foreach my $jid ($conn->getJIDs()) {
         $blist .= getSingleBuddyList($jid);
     }
@@ -513,5 +513,5 @@
             my $errStr =
               "You are logged into multiple accounts. Please specify an account to log out of.\n";
-            foreach my $jid ( $conn->getJids() ) {
+            foreach my $jid ( $conn->getJIDs() ) {
                 $errStr .= "\t$jid\n";
             }
@@ -522,5 +522,5 @@
             if ( $_[1] eq '-a' )    #All accounts.
             {
-                foreach my $jid ( $conn->getJids() ) {
+                foreach my $jid ( $conn->getJIDs() ) {
                     do_logout($jid);
                 }
@@ -535,5 +535,5 @@
     else                            # Only one account logged in.
     {
-        do_logout( ( $conn->getJids() )[0] );
+        do_logout( ( $conn->getJIDs() )[0] );
     }
     return "";
@@ -541,5 +541,5 @@
 
 sub cmd_jlist {
-    if ( !( scalar $conn->getJids() ) ) {
+    if ( !( scalar $conn->getJIDs() ) ) {
         BarnOwl::error("You are not logged in to Jabber.");
         return;
@@ -672,5 +672,5 @@
       or die("Usage: jmuc join MUC [-p password] [-a account]");
 
-    $conn->getConnectionFromJID($jid)->MUCJoin(Jid      => $muc,
+    $conn->getConnectionFromJID($jid)->MUCJoin(JID      => $muc,
                                                   Password => $password,
                                                   History  => {
@@ -794,5 +794,5 @@
     my @groups = @{ shift() };
     my $purgeGroups = shift;
-    my $baseJid = baseJID($jid);
+    my $baseJID = baseJID($jid);
 
     my $roster = $conn->getRosterFromJID($jid);
@@ -809,5 +809,5 @@
         $p->SetTo($to);
         $conn->getConnectionFromJID($jid)->Send($p);
-        queue_admin_msg("You ($baseJid) have requested a subscription to ($to)'s presence.");
+        queue_admin_msg("You ($baseJID) have requested a subscription to ($to)'s presence.");
     }
 }
@@ -818,5 +818,5 @@
     my @groups = @{ shift() };
     my $purgeGroups = shift;
-    my $baseJid = baseJID($jid);
+    my $baseJID = baseJID($jid);
 
     my $p = new Net::XMPP::Presence;
@@ -825,5 +825,5 @@
         $p->SetTo($to);
         $conn->getConnectionFromJID($jid)->Send($p);
-        queue_admin_msg("You ($baseJid) have unsubscribed from ($to)'s presence.");
+        queue_admin_msg("You ($baseJID) have unsubscribed from ($to)'s presence.");
     }
 }
@@ -834,5 +834,5 @@
     my @groups = @{ shift() };
     my $purgeGroups = shift;
-    my $baseJid = baseJID($jid);
+    my $baseJID = baseJID($jid);
 
     my $roster = $conn->getRosterFromJID($jid);
@@ -867,5 +867,5 @@
         $item->put_attrib(name => $name) if $name;
         $conn->getConnectionFromJID($jid)->Send($iq);
-        my $msg = "$baseJid: "
+        my $msg = "$baseJID: "
           . ($name ? "$name ($to)" : "($to)")
           . " is on your roster in the following groups: { "
@@ -881,5 +881,5 @@
     my @groups = @{ shift() };
     my $purgeGroups = shift;
-    my $baseJid = baseJID($jid);
+    my $baseJID = baseJID($jid);
 
     my $iq = new Net::XMPP::IQ;
@@ -891,5 +891,5 @@
         $item->put_attrib(jid => $to);
         $conn->getConnectionFromJID($jid)->Send($iq);
-        queue_admin_msg("You ($baseJid) have removed ($to) from your roster.");
+        queue_admin_msg("You ($baseJID) have removed ($to) from your roster.");
     }
 }
@@ -900,5 +900,5 @@
     my @groups = @{ shift() };
     my $purgeGroups = shift;
-    my $baseJid = baseJID($jid);
+    my $baseJID = baseJID($jid);
 
     my $p = new Net::XMPP::Presence;
@@ -907,5 +907,5 @@
         $p->SetTo($to);
         $conn->getConnectionFromJID($jid)->Send($p);
-        queue_admin_msg("($to) has been subscribed to your ($baseJid) presence.");
+        queue_admin_msg("($to) has been subscribed to your ($baseJID) presence.");
     }
 }
@@ -916,5 +916,5 @@
     my @groups = @{ shift() };
     my $purgeGroups = shift;
-    my $baseJid = baseJID($jid);
+    my $baseJID = baseJID($jid);
 
     my $p = new Net::XMPP::Presence;
@@ -923,5 +923,5 @@
         $p->SetTo($to);
         $conn->getConnectionFromJID($jid)->Send($p);
-        queue_admin_msg("($to) has been unsubscribed from your ($baseJid) presence.");
+        queue_admin_msg("($to) has been unsubscribed from your ($baseJID) presence.");
     }
 }
@@ -1084,9 +1084,9 @@
 
     # Find a connection to reply with.
-    foreach my $jid ($conn->getJids()) {
-	my $cJid = new Net::XMPP::JID;
-	$cJid->SetJID($jid);
-	if ($to eq $cJid->GetJID('base') ||
-            $to eq $cJid->GetJID('full')) {
+    foreach my $jid ($conn->getJIDs()) {
+	my $cJID = new Net::XMPP::JID;
+	$cJID->SetJID($jid);
+	if ($to eq $cJID->GetJID('base') ||
+            $to eq $cJID->GetJID('full')) {
 	    my $reply = $p->Reply(type=>"unsubscribed");
 	    $conn->getConnectionFromJID($jid)->Send($reply);
@@ -1239,40 +1239,40 @@
 
 sub defaultJID {
-    return ( $conn->getJids() )[0] if ( $conn->connected() == 1 );
+    return ( $conn->getJIDs() )[0] if ( $conn->connected() == 1 );
     return;
 }
 
 sub baseJID {
-    my $givenJidStr = shift;
-    my $givenJid    = new Net::XMPP::JID;
-    $givenJid->SetJID($givenJidStr);
-    return $givenJid->GetJID('base');
+    my $givenJIDStr = shift;
+    my $givenJID    = new Net::XMPP::JID;
+    $givenJID->SetJID($givenJIDStr);
+    return $givenJID->GetJID('base');
 }
 
 sub resolveConnectedJID {
-    my $givenJidStr = shift;
-    my $givenJid    = new Net::XMPP::JID;
-    $givenJid->SetJID($givenJidStr);
+    my $givenJIDStr = shift;
+    my $givenJID    = new Net::XMPP::JID;
+    $givenJID->SetJID($givenJIDStr);
 
     # Account fully specified.
-    if ( $givenJid->GetResource() ) {
+    if ( $givenJID->GetResource() ) {
         # Specified account exists
-        return $givenJidStr if ($conn->jidExists($givenJidStr) );
-        die("Invalid account: $givenJidStr");
+        return $givenJIDStr if ($conn->jidExists($givenJIDStr) );
+        die("Invalid account: $givenJIDStr");
     }
 
     # Disambiguate.
     else {
-        my $matchingJid = "";
+        my $matchingJID = "";
         my $errStr =
           "Ambiguous account reference. Please specify a resource.\n";
         my $ambiguous = 0;
 
-        foreach my $jid ( $conn->getJids() ) {
-            my $cJid = new Net::XMPP::JID;
-            $cJid->SetJID($jid);
-            if ( $givenJidStr eq $cJid->GetJID('base') ) {
-                $ambiguous = 1 if ( $matchingJid ne "" );
-                $matchingJid = $jid;
+        foreach my $jid ( $conn->getJIDs() ) {
+            my $cJID = new Net::XMPP::JID;
+            $cJID->SetJID($jid);
+            if ( $givenJIDStr eq $cJID->GetJID('base') ) {
+                $ambiguous = 1 if ( $matchingJID ne "" );
+                $matchingJID = $jid;
                 $errStr .= "\t$jid\n";
             }
@@ -1285,11 +1285,11 @@
 
         # Not one of ours.
-        elsif ( $matchingJid eq "" ) {
-            die("Invalid account: $givenJidStr");
+        elsif ( $matchingJID eq "" ) {
+            die("Invalid account: $givenJIDStr");
         }
 
         # It's this one.
         else {
-            return $matchingJid;
+            return $matchingJID;
         }
     }
@@ -1304,5 +1304,5 @@
     my @jids = $roster->jids('all');
     for my $j (@jids) {
-        if(($roster->query($j, 'name') || "") eq $to) {
+        if(($roster->query($j, 'name') || $j->GetUserID()) eq $to) {
             return $j->GetJID('full');
         } elsif($j->GetJID('base') eq baseJID($to)) {
