Make fallback user mentions support also match against the bot's room-specific username
It seems like Element iOS benefits from this.
This commit is contained in:
@@ -15,6 +15,8 @@ pub struct MessageContext {
|
||||
admin_whitelist_regexes: Vec<regex::Regex>,
|
||||
trigger_event_info: TriggerEventInfo,
|
||||
thread_info: ThreadInfo,
|
||||
|
||||
bot_display_name: Option<String>,
|
||||
}
|
||||
|
||||
impl MessageContext {
|
||||
@@ -31,9 +33,20 @@ impl MessageContext {
|
||||
admin_whitelist_regexes,
|
||||
trigger_event_info,
|
||||
thread_info,
|
||||
|
||||
bot_display_name: None,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn with_bot_display_name(mut self, value: Option<String>) -> Self {
|
||||
self.bot_display_name = value;
|
||||
self
|
||||
}
|
||||
|
||||
pub fn bot_display_name(&self) -> &Option<String> {
|
||||
&self.bot_display_name
|
||||
}
|
||||
|
||||
pub fn room(&self) -> &Room {
|
||||
&self.room
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user