From c09faea091dfdabeb4cbe7f1c9c06da9b46f45fd Mon Sep 17 00:00:00 2001 From: manuroe Date: Wed, 10 Jul 2019 08:20:05 +0200 Subject: [PATCH] Edits history: Display original event #2559 --- Riot/Modules/Room/EditHistory/EditHistoryViewModel.swift | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Riot/Modules/Room/EditHistory/EditHistoryViewModel.swift b/Riot/Modules/Room/EditHistory/EditHistoryViewModel.swift index 47948eb98c..461f32699a 100644 --- a/Riot/Modules/Room/EditHistory/EditHistoryViewModel.swift +++ b/Riot/Modules/Room/EditHistory/EditHistoryViewModel.swift @@ -114,6 +114,15 @@ final class EditHistoryViewModel: EditHistoryViewModelType { sself.operation = nil sself.process(editEvents: response.chunk) + + if response.nextBatch == nil { + // Append the original event when hitting the end of the edits history + if let originalEvent = response.originalEvent { + sself.process(editEvents: [originalEvent]) + } else { + print("[EditHistoryViewModel] loadMoreHistory: The homeserver did not return the original event") + } + } }, failure: { [weak self] error in guard let sself = self else {