Skip to content
This repository has been archived by the owner on Dec 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request #233 from matrix-org/vector_970
Browse files Browse the repository at this point in the history
Bug Fix - Duplicated msg when going into room details
  • Loading branch information
giomfo authored Jan 25, 2017
2 parents 09b035c + 41ec8e5 commit 49d013a
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions MatrixKit/Models/Room/MXKRoomDataSource.m
Original file line number Diff line number Diff line change
Expand Up @@ -1663,27 +1663,16 @@ - (void)didReceiveReceiptEvent:(MXEvent *)receiptEvent roomState:(MXRoomState *)

- (void)handleUnsentMessages
{
// Clean outgoing messages, and add unsent ones at the end of the conversation
// Add the unsent messages at the end of the conversation
NSArray<MXEvent*>* outgoingMessages = _room.outgoingMessages;
BOOL shouldProcessQueuedEvents = NO;

for (NSInteger index = 0; index < outgoingMessages.count; index++)
{
MXEvent *outgoingMessage = [outgoingMessages objectAtIndex:index];

// Remove successfully sent messages
if (outgoingMessage.isLocalEvent == NO)
if (outgoingMessage.sentState != MXEventSentStateSent)
{
[_room removeOutgoingMessage:outgoingMessage.eventId];
}
else
{
// Here the message sending has failed
outgoingMessage.sentState = MXEventSentStateFailed;

// Erase the timestamp
outgoingMessage.originServerTs = kMXUndefinedTimestamp;

[self queueEventForProcessing:outgoingMessage withRoomState:_room.state direction:MXTimelineDirectionForwards];
shouldProcessQueuedEvents = YES;
}
Expand Down

0 comments on commit 49d013a

Please sign in to comment.