Commit 5aa061a1 authored by Julian Sparber's avatar Julian Sparber
Browse files

Revert "Fix message replacement and removal in room_history"

This commit breaks edited messages. It looks like it doesn't replace the
correct message after the changes in this commit.
This reverts commit eebb5b5d.
parent fbf2027d
Pipeline #254941 passed with stages
in 44 minutes and 7 seconds
......@@ -81,8 +81,8 @@ impl List {
/// ### Panics
/// Panics if `index >= len`.
fn remove_item(&mut self, index: usize) {
self.view.remove(index);
self.list.remove(self.list.len() - index - 1);
self.list.remove(index);
self.view.remove(self.list.len() - index - 1);
}
/// Replaces the element at the given position in the history.
......@@ -90,10 +90,10 @@ impl List {
/// ### Panics
/// Panics if `index >= len`.
fn replace_item(&mut self, index: usize, element: Element) {
self.view.remove(index);
self.view.insert(index, element.get_listbox_row());
let i_rev = self.list.len() - index - 1;
self.list[i_rev] = element;
self.view.remove(self.list.len() - index - 1);
self.view
.insert(self.list.len() - index - 1, element.get_listbox_row());
self.list[index] = element;
}
fn create_new_message_divider(rows: Rc<RefCell<Self>>) -> widgets::NewMessageDivider {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment