зеркало из https://github.com/nextcloud/talk-ios.git
Make sure query is unique when querying temporary messages
Signed-off-by: Marcel Müller <marcel-mueller@gmx.de>
This commit is contained in:
Родитель
ca4c49cb55
Коммит
fdc4debe45
|
@ -124,7 +124,7 @@ NSString * const NCChatControllerDidRemoveTemporaryMessagesNotification
|
|||
message.parentId = parent.internalId;
|
||||
|
||||
if (message.referenceId && ![message.referenceId isEqualToString:@""]) {
|
||||
NCChatMessage *managedTemporaryMessage = [NCChatMessage objectsWhere:@"referenceId = %@", message.referenceId].firstObject;
|
||||
NCChatMessage *managedTemporaryMessage = [NCChatMessage objectsWhere:@"referenceId = %@ AND isTemporary = true", message.referenceId].firstObject;
|
||||
if (managedTemporaryMessage) {
|
||||
[realm deleteObject:managedTemporaryMessage];
|
||||
// Create a unmanaged copy of message, since 'message' will point to a managed object when added to the DB.
|
||||
|
@ -271,7 +271,7 @@ NSString * const NCChatControllerDidRemoveTemporaryMessagesNotification
|
|||
{
|
||||
RLMRealm *realm = [RLMRealm defaultRealm];
|
||||
[realm transactionWithBlock:^{
|
||||
NCChatMessage *managedChatMessage = [NCChatMessage objectsWhere:@"referenceId = %@", referenceId].firstObject;
|
||||
NCChatMessage *managedChatMessage = [NCChatMessage objectsWhere:@"referenceId = %@ AND isTemporary = true", referenceId].firstObject;
|
||||
managedChatMessage.sendingFailed = YES;
|
||||
}];
|
||||
}
|
||||
|
|
|
@ -654,7 +654,7 @@ NSString * const NCChatViewControllerReplyPrivatelyNotification = @"NCChatViewCo
|
|||
{
|
||||
RLMRealm *realm = [RLMRealm defaultRealm];
|
||||
[realm transactionWithBlock:^{
|
||||
NCChatMessage *managedTemporaryMessage = [NCChatMessage objectsWhere:@"referenceId = %@", temporaryMessage.referenceId].firstObject;
|
||||
NCChatMessage *managedTemporaryMessage = [NCChatMessage objectsWhere:@"referenceId = %@ AND isTemporary = true", temporaryMessage.referenceId].firstObject;
|
||||
if (managedTemporaryMessage) {
|
||||
[realm deleteObject:managedTemporaryMessage];
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче