mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-06 23:15:08 -04:00
fix(sdk): Don't send notifications for your own user
This commit is contained in:
@@ -373,19 +373,25 @@ impl BaseClient {
|
||||
}
|
||||
|
||||
if let Some(context) = &push_context {
|
||||
let actions = push_rules.get_actions(&event.event, context).to_vec();
|
||||
if event
|
||||
.event
|
||||
.get_field::<OwnedUserId>("sender")?
|
||||
.map_or(false, |id| id == user_id)
|
||||
{
|
||||
let actions = push_rules.get_actions(&event.event, context).to_vec();
|
||||
|
||||
if actions.iter().any(|a| matches!(a, Action::Notify)) {
|
||||
changes.add_notification(
|
||||
room_id,
|
||||
Notification::new(
|
||||
actions,
|
||||
event.event.clone(),
|
||||
false,
|
||||
room_id.to_owned(),
|
||||
MilliSecondsSinceUnixEpoch::now(),
|
||||
),
|
||||
);
|
||||
if actions.iter().any(|a| matches!(a, Action::Notify)) {
|
||||
changes.add_notification(
|
||||
room_id,
|
||||
Notification::new(
|
||||
actions,
|
||||
event.event.clone(),
|
||||
false,
|
||||
room_id.to_owned(),
|
||||
MilliSecondsSinceUnixEpoch::now(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
// TODO if there is an
|
||||
// Action::SetTweak(Tweak::Highlight) we need to store
|
||||
|
||||
Reference in New Issue
Block a user