From f6e2e313aaec4e77a97a52315ec002437a9c45d1 Mon Sep 17 00:00:00 2001
From: Niamh Nikali <niamh@elixxir.io>
Date: Wed, 5 Aug 2020 16:53:37 -0700
Subject: [PATCH] Use cl.sessionv2 instead of global

---
 .gitignore    | 4 +++-
 api/client.go | 4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/.gitignore b/.gitignore
index 9f03361f7..62d17d343 100644
--- a/.gitignore
+++ b/.gitignore
@@ -27,6 +27,8 @@ localdev_*
 *.class
 *.aar
 *.jar
-# Ignore test output
+# Ignore test output related to ekv
 .ekv*
 .*test*
+*.1
+*.2
diff --git a/api/client.go b/api/client.go
index e4681316d..37930e50f 100644
--- a/api/client.go
+++ b/api/client.go
@@ -441,7 +441,7 @@ type SearchCallback interface {
 func (cl *Client) SearchForUser(emailAddress string,
 	cb SearchCallback, timeout time.Duration) {
 	//see if the user has been searched before, if it has, return it
-	contact, err := io.SessionV2.GetContact(emailAddress)
+	contact, err := cl.sessionV2.GetContact(emailAddress)
 
 	// if we successfully got the contact, return it.
 	// errors can include the email address not existing,
@@ -462,7 +462,7 @@ func (cl *Client) SearchForUser(emailAddress string,
 				return
 			}
 			//store the user so future lookups can find it
-			io.SessionV2.SetContact(emailAddress, contact)
+			err = cl.sessionV2.SetContact(emailAddress, contact)
 
 			// If there is something in the channel then send it; otherwise,
 			// skip over it
-- 
GitLab