aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/Source/Remote
diff options
context:
space:
mode:
authorGravatar zxu <zxu@google.com>2018-02-15 17:23:08 -0500
committerGravatar GitHub <noreply@github.com>2018-02-15 17:23:08 -0500
commitfd9fd271d0dba3935a6f5611a1554f2c59b696af (patch)
treebe6d8355254891cb83201c7bfac2082c0f95978f /Firestore/Source/Remote
parent6889850b251ab56186bc13765baee0c3d0f1ae61 (diff)
replacing Auth/FSTUser by C++ auth implementation (#804)
* replacing Auth/FSTUser by C++ auth implementation * address changes
Diffstat (limited to 'Firestore/Source/Remote')
-rw-r--r--Firestore/Source/Remote/FSTRemoteStore.h5
-rw-r--r--Firestore/Source/Remote/FSTRemoteStore.mm11
2 files changed, 12 insertions, 4 deletions
diff --git a/Firestore/Source/Remote/FSTRemoteStore.h b/Firestore/Source/Remote/FSTRemoteStore.h
index b5dd204..4ea9379 100644
--- a/Firestore/Source/Remote/FSTRemoteStore.h
+++ b/Firestore/Source/Remote/FSTRemoteStore.h
@@ -19,6 +19,8 @@
#import "Firestore/Source/Core/FSTTypes.h"
#import "Firestore/Source/Model/FSTDocumentVersionDictionary.h"
+#include "Firestore/core/src/firebase/firestore/auth/user.h"
+
@class FSTDatastore;
@class FSTDocumentKey;
@class FSTLocalStore;
@@ -28,7 +30,6 @@
@class FSTQueryData;
@class FSTRemoteEvent;
@class FSTTransaction;
-@class FSTUser;
NS_ASSUME_NONNULL_BEGIN
@@ -121,7 +122,7 @@ NS_ASSUME_NONNULL_BEGIN
* In response the remote store tears down streams and clears up any tracked operations that should
* not persist across users. Restarts the streams if appropriate.
*/
-- (void)userDidChange:(FSTUser *)user;
+- (void)userDidChange:(const firebase::firestore::auth::User &)user;
/** Listens to the target identified by the given FSTQueryData. */
- (void)listenToTargetWithQueryData:(FSTQueryData *)queryData;
diff --git a/Firestore/Source/Remote/FSTRemoteStore.mm b/Firestore/Source/Remote/FSTRemoteStore.mm
index 123df49..c6668bf 100644
--- a/Firestore/Source/Remote/FSTRemoteStore.mm
+++ b/Firestore/Source/Remote/FSTRemoteStore.mm
@@ -35,6 +35,12 @@
#import "Firestore/Source/Util/FSTAssert.h"
#import "Firestore/Source/Util/FSTLogger.h"
+#include "Firestore/core/src/firebase/firestore/auth/user.h"
+#include "Firestore/core/src/firebase/firestore/util/string_apple.h"
+
+namespace util = firebase::firestore::util;
+using firebase::firestore::auth::User;
+
NS_ASSUME_NONNULL_BEGIN
/**
@@ -268,8 +274,9 @@ static const int kOnlineAttemptsBeforeFailure = 2;
[self updateOnlineState:FSTOnlineStateUnknown];
}
-- (void)userDidChange:(FSTUser *)user {
- FSTLog(@"FSTRemoteStore %p changing users: %@", (__bridge void *)self, user);
+- (void)userDidChange:(const User &)user {
+ FSTLog(@"FSTRemoteStore %p changing users: %@", (__bridge void *)self,
+ util::WrapNSStringNoCopy(user.uid()));
if ([self isNetworkEnabled]) {
// Tear down and re-create our network streams. This will ensure we get a fresh auth token
// for the new user and re-fill the write pipeline with new mutations from the LocalStore