Deduplicate code
This commit is contained in:
parent
fb164eeaa9
commit
d74282581c
1 changed files with 1 additions and 12 deletions
|
|
@ -235,7 +235,7 @@ impl Room {
|
||||||
d.from_nick, d.from_room
|
d.from_nick, d.from_room
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
Data::SendEvent(SendEvent(msg)) => {
|
Data::SendEvent(SendEvent(msg)) | Data::SendReply(SendReply(msg)) => {
|
||||||
let own_user_id = self.own_user_id();
|
let own_user_id = self.own_user_id();
|
||||||
if let Some(last_msg_id) = &mut self.last_msg_id {
|
if let Some(last_msg_id) = &mut self.last_msg_id {
|
||||||
logging_unwrap!(
|
logging_unwrap!(
|
||||||
|
|
@ -263,17 +263,6 @@ impl Room {
|
||||||
.await
|
.await
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
Data::SendReply(SendReply(msg)) => {
|
|
||||||
let own_user_id = self.own_user_id();
|
|
||||||
if let Some(last_msg_id) = &mut self.last_msg_id {
|
|
||||||
logging_unwrap!(
|
|
||||||
self.vault
|
|
||||||
.add_msg(Box::new(msg.clone()), *last_msg_id, own_user_id)
|
|
||||||
.await
|
|
||||||
);
|
|
||||||
*last_msg_id = Some(msg.id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue