Don't scroll when other room message is received
This commit is contained in:
parent
752479ccda
commit
e4265e690e
1 changed files with 8 additions and 6 deletions
14
src/app.rs
14
src/app.rs
|
@ -499,10 +499,9 @@ impl AppOp {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn mark_as_read(&self, msgs: Vec<Message>) {
|
pub fn mark_as_read(&self, msg: &Message) {
|
||||||
if let Some(msg) = msgs.iter().filter(|x| x.room == self.active_room).last() {
|
self.backend.send(BKCommand::MarkAsRead(msg.room.clone(),
|
||||||
self.backend.send(BKCommand::MarkAsRead(msg.room.clone(), msg.id.clone())).unwrap();
|
msg.id.clone())).unwrap();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn add_room_member(&mut self, m: Member) {
|
pub fn add_room_member(&mut self, m: Member) {
|
||||||
|
@ -662,8 +661,11 @@ impl AppOp {
|
||||||
}
|
}
|
||||||
|
|
||||||
if !msgs.is_empty() {
|
if !msgs.is_empty() {
|
||||||
self.scroll_down();
|
let fs = msgs.iter().filter(|x| x.room == self.active_room);
|
||||||
self.mark_as_read(msgs);
|
if let Some(msg) = fs.last() {
|
||||||
|
self.scroll_down();
|
||||||
|
self.mark_as_read(msg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if init {
|
if init {
|
||||||
|
|
Loading…
Reference in a new issue