Skip to content

Commit 8c9aa73

Browse files
committed
fix: update msc number
1 parent 7021a21 commit 8c9aa73

File tree

7 files changed

+16
-16
lines changed

7 files changed

+16
-16
lines changed

changelog.d/16858.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Experimental support for [MSC3767](https://github.com/matrix-org/matrix-spec-proposals/pull/3767): the `time_and_day` push rule condition. Contributed by @hanadi92.
1+
Experimental support for [MSC4141](https://github.com/matrix-org/matrix-spec-proposals/pull/3767): the `time_and_day` push rule condition. Contributed by @hanadi92.

rust/src/push/evaluator.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ pub struct PushRuleEvaluator {
107107
/// flag as MSC1767 (extensible events core).
108108
msc3931_enabled: bool,
109109

110-
/// If MSC3767 (time based notification filtering push rule condition) is enabled
111-
msc3767_time_and_day: bool,
110+
/// If MSC4141 (time based notification filtering push rule condition) is enabled
111+
msc4141_time_and_day: bool,
112112
}
113113

114114
#[pymethods]
@@ -126,7 +126,7 @@ impl PushRuleEvaluator {
126126
related_event_match_enabled,
127127
room_version_feature_flags,
128128
msc3931_enabled,
129-
msc3767_time_and_day,
129+
msc4141_time_and_day,
130130
))]
131131
pub fn py_new(
132132
flattened_keys: BTreeMap<String, JsonValue>,
@@ -138,7 +138,7 @@ impl PushRuleEvaluator {
138138
related_event_match_enabled: bool,
139139
room_version_feature_flags: Vec<String>,
140140
msc3931_enabled: bool,
141-
msc3767_time_and_day: bool,
141+
msc4141_time_and_day: bool,
142142
) -> Result<Self, Error> {
143143
let body = match flattened_keys.get("content.body") {
144144
Some(JsonValue::Value(SimpleJsonValue::Str(s))) => s.clone().into_owned(),
@@ -156,7 +156,7 @@ impl PushRuleEvaluator {
156156
related_event_match_enabled,
157157
room_version_feature_flags,
158158
msc3931_enabled,
159-
msc3767_time_and_day,
159+
msc4141_time_and_day,
160160
})
161161
}
162162

@@ -392,7 +392,7 @@ impl PushRuleEvaluator {
392392
}
393393
}
394394
KnownCondition::TimeAndDay(time_and_day) => {
395-
if !self.msc3767_time_and_day {
395+
if !self.msc4141_time_and_day {
396396
false
397397
} else {
398398
self.match_time_and_day(time_and_day.timezone, &time_and_day.intervals)?

rust/src/push/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ pub enum KnownCondition {
362362
RoomVersionSupports {
363363
feature: Cow<'static, str>,
364364
},
365-
#[serde(rename = "org.matrix.msc3767.time_and_day")]
365+
#[serde(rename = "org.matrix.msc4141.time_and_day")]
366366
TimeAndDay(TimeAndDayCondition),
367367
}
368368

@@ -455,7 +455,7 @@ pub struct TimeAndDayCondition {
455455
pub struct TimeAndDayIntervals {
456456
/// Tuple of hh::mm representing start and end times of the day
457457
pub time_of_day: Option<TimeInterval>,
458-
/// 0 = Sunday, 1 = Monday, ..., 7 = Sunday
458+
/// 0 = Sunday, 1 = Monday, ..., 6 = Saturday
459459
pub day_of_week: Vec<u32>,
460460
}
461461

synapse/config/experimental.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ def read_config(self, config: JsonDict, **kwargs: Any) -> None:
437437
"msc4115_membership_on_events", False
438438
)
439439

440-
# MSC3767: time based notification filtering
441-
self.msc3767_time_and_day = experimental.get(
442-
"org.matrix.msc3767.time_and_day", False
440+
# MSC4141: time based notification filtering
441+
self.msc4141_time_and_day = experimental.get(
442+
"org.matrix.msc4141.time_and_day", False
443443
)

synapse/push/bulk_push_rule_evaluator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ async def _action_for_event_by_user(
435435
self._related_event_match_enabled,
436436
event.room_version.msc3931_push_features,
437437
self.hs.config.experimental.msc1767_enabled, # MSC3931 flag
438-
self.hs.config.experimental.msc3767_time_and_day,
438+
self.hs.config.experimental.msc4141_time_and_day,
439439
)
440440

441441
for uid, rules in rules_by_user.items():

synapse/synapse_rust/push.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class PushRuleEvaluator:
6565
related_event_match_enabled: bool,
6666
room_version_feature_flags: Tuple[str, ...],
6767
msc3931_enabled: bool,
68-
msc3767_time_and_day: bool,
68+
msc4141_time_and_day: bool,
6969
): ...
7070
def run(
7171
self,

tests/push/test_push_rule_evaluator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def _get_evaluator(
174174
related_event_match_enabled=True,
175175
room_version_feature_flags=event.room_version.msc3931_push_features,
176176
msc3931_enabled=True,
177-
msc3767_time_and_day=True,
177+
msc4141_time_and_day=True,
178178
)
179179

180180
def test_display_name(self) -> None:
@@ -806,7 +806,7 @@ def test_related_event_match_no_related_event(self) -> None:
806806
def test_time_and_day_match(self) -> None:
807807
# for testing, make whole day in do not disturb
808808
condition = {
809-
"kind": "org.matrix.msc3767.time_and_day",
809+
"kind": "org.matrix.msc4141.time_and_day",
810810
"timezone": None,
811811
"intervals": [
812812
{

0 commit comments

Comments
 (0)