Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete unsend messages, not working for failed messages. showing the unsend message delete/retry button for ever. #6334

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions Riot/Modules/MatrixKit/Models/Room/MXKRoomDataSource.m
Original file line number Diff line number Diff line change
Expand Up @@ -2356,15 +2356,14 @@ - (void)removeEventWithEventId:(NSString *)eventId
{
[self removeCellData:bubbleData];
}

// Remove the event from the outgoing messages storage
[_room removeOutgoingMessage:eventId];
}
// Remove the event from the outgoing messages storage
[_room removeOutgoingMessage:eventId];

// Update the delegate
if (self.delegate)
{
[self.delegate dataSource:self didCellChange:nil];
}
// Update the delegate
if (self.delegate)
{
[self.delegate dataSource:self didCellChange:nil];
}
}

Expand Down
18 changes: 6 additions & 12 deletions Riot/Modules/Room/RoomViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -5912,18 +5912,12 @@ - (void)cancelAllUnsentMessages
[cancelAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n delete] style:UIAlertActionStyleDestructive handler:^(UIAlertAction * action) {
MXStrongifyAndReturnIfNil(self);
// Remove unsent event ids
for (NSUInteger index = 0; index < self.roomDataSource.room.outgoingMessages.count;)
{
MXEvent *event = self.roomDataSource.room.outgoingMessages[index];
if (event.sentState == MXEventSentStateFailed)
{
[self.roomDataSource removeEventWithEventId:event.eventId];
}
else
{
index ++;
}
}
[self.roomDataSource.room.outgoingMessages enumerateObjectsUsingBlock:^(MXEvent *event, NSUInteger idx, BOOL *stop) {
if (event.sentState == MXEventSentStateFailed)
{
[self.roomDataSource removeEventWithEventId:event.eventId];
}
}];

[self refreshActivitiesViewDisplay];
self->currentAlert = nil;
Expand Down
1 change: 1 addition & 0 deletions changelog.d/6344.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Warning Alert: fix failed message delete / retry not getting cancelled for ever when there is no cell data, but has unsend message event.