Handle Matrix User presence as following:

- set Online when app is active.
- set Unavailable when app is suspended (inactive).
- set Offline when user logs out the app (this option is currently commented because the user is kept offline when he logs in again from web client).

Multidevice handling: the app compares the presence from server with the local value in order to keep the most pertinent.
This commit is contained in:
giomfo
2014-12-09 18:21:39 +01:00
parent 2a6c0b1fec
commit cee1ddd287
3 changed files with 85 additions and 21 deletions
+2 -1
View File
@@ -36,6 +36,7 @@ extern NSString *const kMatrixHandlerUnsupportedMessagePrefix;
// Matrix user's settings
@property (strong, nonatomic) NSString *userDisplayName;
@property (strong, nonatomic) NSString *userPictureURL;
@property (nonatomic) MXPresence userPresence;
@property (nonatomic,readonly) BOOL isLogged;
@property (nonatomic,readonly) BOOL isInitialSyncDone;
@@ -43,7 +44,7 @@ extern NSString *const kMatrixHandlerUnsupportedMessagePrefix;
+ (MatrixHandler *)sharedHandler;
- (void)pause;
- (void)pauseInBackgroundTask;
- (void)resume;
- (void)logout;