Skip to content

Commit

Permalink
Update to stable identifiers.
Browse files Browse the repository at this point in the history
  • Loading branch information
clokep committed Mar 6, 2023
1 parent 55cdb39 commit a52c302
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion spec/unit/pushprocessor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ describe("NotificationService", function () {
actions: [PushRuleActionName.Notify],
conditions: [
{
kind: ConditionKind.EventPropertyContainsPrefix,
kind: ConditionKind.EventPropertyContains,
key: "content.foo",
value: value,
},
Expand Down
7 changes: 3 additions & 4 deletions src/@types/PushRules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export function isDmMemberCountCondition(condition: AnyMemberCountCondition): bo
export enum ConditionKind {
EventMatch = "event_match",
EventPropertyIs = "event_property_is",
EventPropertyContainsPrefix = "org.matrix.msc3966.exact_event_property_contains",
EventPropertyContains = "event_property_contains",
ContainsDisplayName = "contains_display_name",
RoomMemberCount = "room_member_count",
SenderNotificationPermission = "sender_notification_permission",
Expand All @@ -89,8 +89,7 @@ export interface IEventPropertyIsCondition extends IPushRuleCondition<ConditionK
value: string | boolean | null | number;
}

export interface IEventPropertyContainsPrefixCondition
extends IPushRuleCondition<ConditionKind.EventPropertyContainsPrefix> {
export interface IEventPropertyContainsCondition extends IPushRuleCondition<ConditionKind.EventPropertyContains> {
key: string;
value: string | boolean | null | number;
}
Expand Down Expand Up @@ -121,7 +120,7 @@ export interface ICallStartedPrefixCondition extends IPushRuleCondition<Conditio
export type PushRuleCondition =
| IEventMatchCondition
| IEventPropertyIsCondition
| IEventPropertyContainsPrefixCondition
| IEventPropertyContainsCondition
| IContainsDisplayNameCondition
| IRoomMemberCountCondition
| ISenderNotificationPermissionCondition
Expand Down
6 changes: 3 additions & 3 deletions src/pushprocessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
IContainsDisplayNameCondition,
IEventMatchCondition,
IEventPropertyIsCondition,
IEventPropertyContainsPrefixCondition,
IEventPropertyContainsCondition,
IPushRule,
IPushRules,
IRoomMemberCountCondition,
Expand Down Expand Up @@ -341,7 +341,7 @@ export class PushProcessor {
return this.eventFulfillsEventMatchCondition(cond, ev);
case ConditionKind.EventPropertyIs:
return this.eventFulfillsEventPropertyIsCondition(cond, ev);
case ConditionKind.EventPropertyContainsPrefix:
case ConditionKind.EventPropertyContains:
return this.eventFulfillsEventPropertyContains(cond, ev);
case ConditionKind.ContainsDisplayName:
return this.eventFulfillsDisplayNameCondition(cond, ev);
Expand Down Expand Up @@ -498,7 +498,7 @@ export class PushProcessor {
* @param cond - The push rule condition to check for a match.
* @param ev - The event to check for a match.
*/
private eventFulfillsEventPropertyContains(cond: IEventPropertyContainsPrefixCondition, ev: MatrixEvent): boolean {
private eventFulfillsEventPropertyContains(cond: IEventPropertyContainsCondition, ev: MatrixEvent): boolean {
if (!cond.key || cond.value === undefined) {
return false;
}
Expand Down

0 comments on commit a52c302

Please sign in to comment.