BF: Edits: editing an unsent msg gets cancelled if the original msg send completes during the edit

#2495
This commit is contained in:
manuroe
2019-06-27 12:25:01 +02:00
parent dba3a0bbd7
commit 0584228bed
+14
View File
@@ -287,6 +287,7 @@
// Listen to the event sent state changes
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(eventDidChangeSentState:) name:kMXEventDidChangeSentStateNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(eventDidChangeIdentifier:) name:kMXEventDidChangeIdentifierNotification object:nil];
}
- (void)viewDidLoad
@@ -1221,6 +1222,7 @@
missedDiscussionsBadgeLabel = nil;
[[NSNotificationCenter defaultCenter] removeObserver:self name:kMXEventDidChangeSentStateNotification object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self name:kMXEventDidChangeIdentifierNotification object:nil];
[super destroy];
}
@@ -4564,6 +4566,18 @@
}
}
- (void)eventDidChangeIdentifier:(NSNotification *)notif
{
MXEvent *event = notif.object;
NSString *previousId = notif.userInfo[kMXEventIdentifierKey];
if ([customizedRoomDataSource.selectedEventId isEqualToString:previousId])
{
NSLog(@"[RoomVC] eventDidChangeIdentifier: Update selectedEventId");
customizedRoomDataSource.selectedEventId = event.eventId;
}
}
- (void)resendAllUnsentMessages
{