Skip to content

Commit

Permalink
Bug Fix: Riot looks to me like I'm sending the same message twice.
Browse files Browse the repository at this point in the history
element-hq/element-ios#894

Move the local echo suppression from `MXKRoomDataSource` to `MXEventTimeline` class.
  • Loading branch information
giomfo committed Jan 18, 2017
1 parent 5f17663 commit c2d1197
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions MatrixSDK/Data/MXEventTimeline.m
Original file line number Diff line number Diff line change
Expand Up @@ -819,6 +819,20 @@ - (void)notifyListeners:(MXEvent*)event direction:(MXTimelineDirection)direction
[listener notify:event direction:direction andCustomObject:roomState];
}
}

if (_isLiveTimeline)
{
// Check for local echo suppression
if (room.outgoingMessages.count && [event.sender isEqualToString:room.mxSession.myUser.userId])
{
MXEvent *localEcho = [room pendingLocalEchoRelatedToEvent:event];
if (localEcho)
{
// Remove the event from the pending local echo list
[room removePendingLocalEcho:localEcho.eventId];
}
}
}
}

@end

0 comments on commit c2d1197

Please sign in to comment.