Refactor displayname and fix avatar_url
This commit is contained in:
parent
5248f83af9
commit
a680a4e52d
1 changed files with 14 additions and 14 deletions
|
@ -74,31 +74,30 @@ impl StateRow {
|
|||
Some(AnyStateEventContent::RoomMember(prev))
|
||||
if event.displayname != prev.displayname =>
|
||||
{
|
||||
if prev.displayname == None {
|
||||
if let Some(prev_name) = prev.displayname {
|
||||
if event.displayname == None {
|
||||
Some(gettext!("{} removed their display name.", prev_name))
|
||||
} else {
|
||||
Some(gettext!(
|
||||
"{} changed their display name to {}.",
|
||||
prev_name,
|
||||
display_name
|
||||
))
|
||||
}
|
||||
} else {
|
||||
Some(gettext!(
|
||||
"{} set their display name to {}.",
|
||||
state.state_key(),
|
||||
display_name
|
||||
))
|
||||
} else if event.displayname == None {
|
||||
Some(gettext!(
|
||||
"{} removed their display name.",
|
||||
prev.displayname.unwrap()
|
||||
))
|
||||
} else {
|
||||
Some(gettext!(
|
||||
"{} changed their display name to {}.",
|
||||
prev.displayname.unwrap(),
|
||||
display_name
|
||||
))
|
||||
}
|
||||
}
|
||||
Some(AnyStateEventContent::RoomMember(prev))
|
||||
if event.avatar_url != prev.avatar_url =>
|
||||
{
|
||||
if prev.displayname == None {
|
||||
if prev.avatar_url == None {
|
||||
Some(gettext!("{} set their avatar.", display_name))
|
||||
} else if event.displayname == None {
|
||||
} else if event.avatar_url == None {
|
||||
Some(gettext!("{} removed their avatar.", display_name))
|
||||
} else {
|
||||
Some(gettext!("{} changed their avatar.", display_name))
|
||||
|
@ -113,6 +112,7 @@ impl StateRow {
|
|||
gettext!("{} was invited to this room.", display_name)
|
||||
}
|
||||
MembershipState::Knock => {
|
||||
// TODO: Add button to invite the user.
|
||||
gettext!("{} requested to be invited to this room.", display_name)
|
||||
}
|
||||
MembershipState::Leave => {
|
||||
|
|
Loading…
Reference in a new issue