Specify Ring account when perform name lookup

Use the default Ring account (normally the first Ring account which
is enabled and registered) when performing the name lookup in the
search entry. This way the name server of that account will be used
instea of the default name server. Also this is the account which
should normally be used to send the message / make the call.

Reviewed-by: Alexandre Viau <alexandre.viau@savoirfairelinux.com>
Change-Id: I40b7fc893803921293ff02128ef1a709e7b914db
diff --git a/src/ringmainwindow.cpp b/src/ringmainwindow.cpp
index a73bc78..ab4d239 100644
--- a/src/ringmainwindow.cpp
+++ b/src/ringmainwindow.cpp
@@ -517,6 +517,9 @@
 
         gboolean lookup_username = FALSE;
 
+        /* get the account with which we will do the lookup */
+        auto ring_account = AvailableAccountModel::instance().currentDefaultAccount(URI::SchemeType::RING);
+
         if (uri.protocolHint() == URI::ProtocolHint::RING_USERNAME ) {
             lookup_username = TRUE;
         } else if (
@@ -606,7 +609,7 @@
                 }
             );
 
-            NameDirectory::instance().lookupName(nullptr, QString(), username_to_lookup);
+            NameDirectory::instance().lookupName(ring_account, QString(), username_to_lookup);
         }
         else
         {