Skip to content

Commit 2f3335a

Browse files
committed
Update to stable prefix.
1 parent 42560aa commit 2f3335a

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

spec/unit/pushprocessor.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ describe("NotificationService", function () {
546546
actions: [PushRuleActionName.Notify],
547547
conditions: [
548548
{
549-
kind: ConditionKind.ExactEventMatchPrefix,
549+
kind: ConditionKind.EventPropertyIs,
550550
key: "content.foo",
551551
value: value,
552552
},

src/@types/PushRules.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export function isDmMemberCountCondition(condition: AnyMemberCountCondition): bo
6262

6363
export enum ConditionKind {
6464
EventMatch = "event_match",
65-
ExactEventMatchPrefix = "com.beeper.msc3758.exact_event_match",
65+
EventPropertyIs = "event_property_is",
6666
ContainsDisplayName = "contains_display_name",
6767
RoomMemberCount = "room_member_count",
6868
SenderNotificationPermission = "sender_notification_permission",
@@ -83,7 +83,7 @@ export interface IEventMatchCondition extends IPushRuleCondition<ConditionKind.E
8383
value?: string;
8484
}
8585

86-
export interface IExactEventMatchPrefixCondition extends IPushRuleCondition<ConditionKind.ExactEventMatchPrefix> {
86+
export interface IEventPropertyIsCondition extends IPushRuleCondition<ConditionKind.EventPropertyIs> {
8787
key: string;
8888
value: string | boolean | null | number;
8989
}
@@ -113,7 +113,7 @@ export interface ICallStartedPrefixCondition extends IPushRuleCondition<Conditio
113113
// IPushRuleCondition<Exclude<string, ConditionKind>> unfortunately does not resolve this at the time of writing.
114114
export type PushRuleCondition =
115115
| IEventMatchCondition
116-
| IExactEventMatchPrefixCondition
116+
| IEventPropertyIsCondition
117117
| IContainsDisplayNameCondition
118118
| IRoomMemberCountCondition
119119
| ISenderNotificationPermissionCondition

src/pushprocessor.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import {
2525
ICallStartedPrefixCondition,
2626
IContainsDisplayNameCondition,
2727
IEventMatchCondition,
28-
IExactEventMatchPrefixCondition,
28+
IEventPropertyIsCondition,
2929
IPushRule,
3030
IPushRules,
3131
IRoomMemberCountCondition,
@@ -338,8 +338,8 @@ export class PushProcessor {
338338
switch (cond.kind) {
339339
case ConditionKind.EventMatch:
340340
return this.eventFulfillsEventMatchCondition(cond, ev);
341-
case ConditionKind.ExactEventMatchPrefix:
342-
return this.eventFulfillsExactEventMatchCondition(cond, ev);
341+
case ConditionKind.EventPropertyIs:
342+
return this.eventFulfillsEventPropertyIsCondition(cond, ev);
343343
case ConditionKind.ContainsDisplayName:
344344
return this.eventFulfillsDisplayNameCondition(cond, ev);
345345
case ConditionKind.RoomMemberCount:
@@ -481,7 +481,7 @@ export class PushProcessor {
481481
* @param cond - The push rule condition to check for a match.
482482
* @param ev - The event to check for a match.
483483
*/
484-
private eventFulfillsExactEventMatchCondition(cond: IExactEventMatchPrefixCondition, ev: MatrixEvent): boolean {
484+
private eventFulfillsEventPropertyIsCondition(cond: IEventPropertyIsCondition, ev: MatrixEvent): boolean {
485485
if (!cond.key || cond.value === undefined) {
486486
return false;
487487
}

0 commit comments

Comments
 (0)