user_info.mm 922 B

1234567891011121314151617181920212223242526272829303132333435
  1. // Copyright 2017 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #if !defined(__has_feature) || !__has_feature(objc_arc)
  5. #error "This file requires ARC support."
  6. #endif
  7. #import "remoting/ios/domain/user_info.h"
  8. @implementation UserInfo
  9. @synthesize userId = _userId;
  10. @synthesize userFullName = _userFullName;
  11. @synthesize userEmail = _userEmail;
  12. @synthesize refreshToken = _refreshToken;
  13. - (BOOL)isAuthenticated {
  14. if (_userEmail && _userEmail.length > 0 && _refreshToken &&
  15. _refreshToken.length > 0) {
  16. return YES;
  17. }
  18. return NO;
  19. }
  20. - (NSComparisonResult)compare:(UserInfo*)user {
  21. return [self.userId compare:user.userId];
  22. }
  23. - (NSString*)description {
  24. return [NSString stringWithFormat:@"UserInfo: userEmail=%@ refreshToken=%@",
  25. _userEmail, _refreshToken];
  26. }
  27. @end