mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-19 08:03:50 +02:00
Retrying & deleting failed messages
- If users press on Retry, send again the message and display a loading wheel - code and UI tweaks
This commit is contained in:
@@ -80,6 +80,8 @@
|
||||
|
||||
@property (nonatomic, strong) CellDataComponentIndexPair *sentCell;
|
||||
|
||||
@property (nonatomic, strong) NSMutableSet *failedEventIds;
|
||||
|
||||
@property (nonatomic) RoomBubbleCellData *roomCreationCellData;
|
||||
|
||||
@property (nonatomic) BOOL showRoomCreationCell;
|
||||
@@ -1028,6 +1030,11 @@
|
||||
- (void)updateStatusInfo
|
||||
{
|
||||
self.sentCell = nil;
|
||||
|
||||
if (!self.failedEventIds)
|
||||
{
|
||||
self.failedEventIds = [NSMutableSet new];
|
||||
}
|
||||
|
||||
NSInteger bubbleIndex = bubbles.count;
|
||||
while (bubbleIndex--)
|
||||
@@ -1037,14 +1044,20 @@
|
||||
NSInteger componentIndex = cellData.bubbleComponents.count;
|
||||
while (componentIndex--) {
|
||||
MXKRoomBubbleComponent *component = cellData.bubbleComponents[componentIndex];
|
||||
MXEventSentState eventState = component.event.sentState;
|
||||
|
||||
if (eventState == MXEventSentStateFailed)
|
||||
{
|
||||
[self.failedEventIds addObject:component.event.eventId];
|
||||
continue;
|
||||
}
|
||||
|
||||
NSArray<MXReceiptData*> *receipts = cellData.readReceipts[component.event.eventId];
|
||||
if (receipts.count)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
MXEventSentState eventState = component.event.sentState;
|
||||
|
||||
if (self.sentCell == nil && eventState == MXEventSentStateSent)
|
||||
{
|
||||
self.sentCell = [CellDataComponentIndexPair pairWithCellData:cellData componentIndex:componentIndex];
|
||||
@@ -1092,7 +1105,7 @@
|
||||
|| component.event.sentState == MXEventSentStatePreparing
|
||||
|| component.event.sentState == MXEventSentStateSending)
|
||||
{
|
||||
if (cellData.attachment && component.event.sentState != MXEventSentStateSending)
|
||||
if ([self.failedEventIds containsObject:component.event.eventId] || ( cellData.attachment && component.event.sentState != MXEventSentStateSending))
|
||||
{
|
||||
UIView *progressContentView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 40, 40)];
|
||||
CircleProgressView *progressView = [[CircleProgressView alloc] initWithFrame:CGRectMake(24, 24, 16, 16)];
|
||||
|
||||
Reference in New Issue
Block a user