зеркало из https://github.com/nextcloud/talk-ios.git
Delete chat blocks of an account when removing it.
Signed-off-by: Ivan Sein <ivan@nextcloud.com>
This commit is contained in:
Родитель
632f55b3d1
Коммит
895f38f7cc
|
@ -21,7 +21,9 @@ extern NSString * const NCChatControllerDidRemoveTemporaryMessagesNotification;
|
|||
|
||||
@interface NCChatBlock : RLMObject
|
||||
|
||||
@property (nonatomic, strong) NSString *internalId; // same as room internal id
|
||||
@property (nonatomic, strong) NSString *internalId; // accountId@token (same as room internal id)
|
||||
@property (nonatomic, strong) NSString *accountId;
|
||||
@property (nonatomic, strong) NSString *token;
|
||||
@property (nonatomic, assign) NSInteger oldestMessageId;
|
||||
@property (nonatomic, assign) NSInteger newestMessageId;
|
||||
@property (nonatomic, assign) BOOL hasHistory;
|
||||
|
|
|
@ -210,6 +210,8 @@ NSString * const NCChatControllerDidRemoveTemporaryMessagesNotification
|
|||
// Create new chat block
|
||||
NCChatBlock *newBlock = [[NCChatBlock alloc] init];
|
||||
newBlock.internalId = _room.internalId;
|
||||
newBlock.accountId = _room.accountId;
|
||||
newBlock.token = _room.token;
|
||||
newBlock.oldestMessageId = lastKnown;
|
||||
newBlock.newestMessageId = newestMessageKnown;
|
||||
newBlock.hasHistory = YES;
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
#import "NCDatabaseManager.h"
|
||||
|
||||
#import "NCChatController.h"
|
||||
#import "NCChatMessage.h"
|
||||
#import "NCRoom.h"
|
||||
|
||||
|
@ -149,6 +150,7 @@
|
|||
}
|
||||
[realm deleteObjects:[NCRoom objectsWithPredicate:query]];
|
||||
[realm deleteObjects:[NCChatMessage objectsWithPredicate:query]];
|
||||
[realm deleteObjects:[NCChatBlock objectsWithPredicate:query]];
|
||||
[realm commitWriteTransaction];
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче