|
1 | | -// Copyright 2022 The Matrix.org Foundation C.I.C. |
| 1 | +// Copyright 2022, 2023 The Matrix.org Foundation C.I.C. |
2 | 2 | // |
3 | 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | // you may not use this file except in compliance with the License. |
@@ -208,6 +208,20 @@ pub const BASE_APPEND_OVERRIDE_RULES: &[PushRule] = &[ |
208 | 208 | default: true, |
209 | 209 | default_enabled: true, |
210 | 210 | }, |
| 211 | + PushRule { |
| 212 | + rule_id: Cow::Borrowed("global/override/.org.matrix.msc3930.rule.poll_response"), |
| 213 | + priority_class: 5, |
| 214 | + conditions: Cow::Borrowed(&[Condition::Known(KnownCondition::EventMatch( |
| 215 | + EventMatchCondition { |
| 216 | + key: Cow::Borrowed("type"), |
| 217 | + pattern: Some(Cow::Borrowed("org.matrix.msc3381.poll.response")), |
| 218 | + pattern_type: None, |
| 219 | + }, |
| 220 | + ))]), |
| 221 | + actions: Cow::Borrowed(&[]), |
| 222 | + default: true, |
| 223 | + default_enabled: true, |
| 224 | + }, |
211 | 225 | ]; |
212 | 226 |
|
213 | 227 | pub const BASE_APPEND_CONTENT_RULES: &[PushRule] = &[PushRule { |
@@ -596,6 +610,68 @@ pub const BASE_APPEND_UNDERRIDE_RULES: &[PushRule] = &[ |
596 | 610 | default: true, |
597 | 611 | default_enabled: true, |
598 | 612 | }, |
| 613 | + PushRule { |
| 614 | + rule_id: Cow::Borrowed("global/underride/.org.matrix.msc3930.rule.poll_start_one_to_one"), |
| 615 | + priority_class: 1, |
| 616 | + conditions: Cow::Borrowed(&[ |
| 617 | + Condition::Known(KnownCondition::RoomMemberCount { |
| 618 | + is: Some(Cow::Borrowed("2")), |
| 619 | + }), |
| 620 | + Condition::Known(KnownCondition::EventMatch(EventMatchCondition { |
| 621 | + key: Cow::Borrowed("type"), |
| 622 | + pattern: Some(Cow::Borrowed("org.matrix.msc3381.poll.start")), |
| 623 | + pattern_type: None, |
| 624 | + })), |
| 625 | + ]), |
| 626 | + actions: Cow::Borrowed(&[Action::Notify, SOUND_ACTION]), |
| 627 | + default: true, |
| 628 | + default_enabled: true, |
| 629 | + }, |
| 630 | + PushRule { |
| 631 | + rule_id: Cow::Borrowed("global/underride/.org.matrix.msc3930.rule.poll_start"), |
| 632 | + priority_class: 1, |
| 633 | + conditions: Cow::Borrowed(&[Condition::Known(KnownCondition::EventMatch( |
| 634 | + EventMatchCondition { |
| 635 | + key: Cow::Borrowed("type"), |
| 636 | + pattern: Some(Cow::Borrowed("org.matrix.msc3381.poll.start")), |
| 637 | + pattern_type: None, |
| 638 | + }, |
| 639 | + ))]), |
| 640 | + actions: Cow::Borrowed(&[Action::Notify]), |
| 641 | + default: true, |
| 642 | + default_enabled: true, |
| 643 | + }, |
| 644 | + PushRule { |
| 645 | + rule_id: Cow::Borrowed("global/underride/.org.matrix.msc3930.rule.poll_end_one_to_one"), |
| 646 | + priority_class: 1, |
| 647 | + conditions: Cow::Borrowed(&[ |
| 648 | + Condition::Known(KnownCondition::RoomMemberCount { |
| 649 | + is: Some(Cow::Borrowed("2")), |
| 650 | + }), |
| 651 | + Condition::Known(KnownCondition::EventMatch(EventMatchCondition { |
| 652 | + key: Cow::Borrowed("type"), |
| 653 | + pattern: Some(Cow::Borrowed("org.matrix.msc3381.poll.end")), |
| 654 | + pattern_type: None, |
| 655 | + })), |
| 656 | + ]), |
| 657 | + actions: Cow::Borrowed(&[Action::Notify, SOUND_ACTION]), |
| 658 | + default: true, |
| 659 | + default_enabled: true, |
| 660 | + }, |
| 661 | + PushRule { |
| 662 | + rule_id: Cow::Borrowed("global/underride/.org.matrix.msc3930.rule.poll_end"), |
| 663 | + priority_class: 1, |
| 664 | + conditions: Cow::Borrowed(&[Condition::Known(KnownCondition::EventMatch( |
| 665 | + EventMatchCondition { |
| 666 | + key: Cow::Borrowed("type"), |
| 667 | + pattern: Some(Cow::Borrowed("org.matrix.msc3381.poll.end")), |
| 668 | + pattern_type: None, |
| 669 | + }, |
| 670 | + ))]), |
| 671 | + actions: Cow::Borrowed(&[Action::Notify]), |
| 672 | + default: true, |
| 673 | + default_enabled: true, |
| 674 | + }, |
599 | 675 | ]; |
600 | 676 |
|
601 | 677 | lazy_static! { |
|
0 commit comments