Support hiding server part of username in message scrollback (#71)

This commit is contained in:
Ulyssa 2023-07-06 23:15:58 -07:00
parent 61aba80be1
commit 64891ec68f
No known key found for this signature in database
GPG key ID: F2873CA2997B83C5
8 changed files with 164 additions and 37 deletions

View file

@ -808,7 +808,8 @@ impl<'a> StatefulWidget for Chat<'a> {
state.reply_to.as_ref().and_then(|k| {
let room = self.store.application.rooms.get(state.id())?;
let msg = room.messages.get(k)?;
let user = self.store.application.settings.get_user_span(msg.sender.as_ref());
let user =
self.store.application.settings.get_user_span(msg.sender.as_ref(), room);
let prefix = if editing.is_some() {
Span::from("Editing reply to ")
} else {

View file

@ -139,8 +139,9 @@ impl RoomState {
let mut invited = vec![Span::from(format!("You have been invited to join {name}"))];
if let Ok(Some(inviter)) = &inviter {
let info = store.application.rooms.get_or_default(self.id().to_owned());
invited.push(Span::from(" by "));
invited.push(store.application.settings.get_user_span(inviter.user_id()));
invited.push(store.application.settings.get_user_span(inviter.user_id(), info));
}
let l1 = Spans(invited);