Erik Johnston
436e0eb39a
Fix breaking event sending due to bad push rule ( #13547 )
Broke by #13522
It looks like we have some rules in the DB with a priority class less
than 0 that don't override the base rules. Before these were just
dropped, but #13522 made that a hard error.
1 year ago
Erik Johnston
5442891cbc
Make push rules use proper structures. ( #13522 )
This improves load times for push rules:
| Version | Time per user | Time for 1k users |
| -------------------- | ------------- | ----------------- |
| Before | 138 µs | 138ms |
| Now (with custom) | 2.11 µs | 2.11ms |
| Now (without custom) | 49.7 ns | 0.05 ms |
This therefore has a large impact on send times for rooms
with large numbers of local users in the room.
1 year ago
Šimon Brandner
1017f09c18
Update MSC3786 implementation: Check the `state_key` ( #12939 )
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
1 year ago
Šimon Brandner
042e47970b
Remove `dont_notify` from the `.m.rule.room.server_acl` rule ( #12849 )
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
2 years ago
Patrick Cloke
88ce3080d4
Experimental support for MSC3772 ( #12740 )
Implements the following behind an experimental configuration flag:
* A new push rule kind for mutually related events.
* A new default push rule (`.m.rule.thread_reply`) under an unstable prefix.
This is missing part of MSC3772:
* The `.m.rule.thread_reply_to_me` push rule, this depends on MSC3664 / #11804 .
2 years ago
Šimon Brandner
ade3008821
Implement MSC3786: Add a default push rule to ignore m.room.server_acl events ( #12601 )
Fixes vector-im/element-web#20788
Implements matrix-org/matrix-spec-proposals#3786
2 years ago
Nick Mills-Barrett
735e89bd3a
Add an additional HTTP pusher + push rule tests. ( #12188 )
And rename the field used for caching from _id to _cache_key.
2 years ago
Sean Quah
e6acd3cf4f
Upgrade mypy to version 0.931 ( #12030 )
Upgrade mypy to 0.931, mypy-zope to 0.3.5 and fix new complaints.
2 years ago
Patrick Cloke
acda9f07c8
Revert experimental push rules from #7997 . ( #11884 )
Manually reverts the merge from cdbb8e6d6e
.
2 years ago
Patrick Cloke
5d34f40d49
Add type hints to the push module. ( #8901 )
3 years ago
David Baker
59cc2472b3
Add base pushrule to notify for jitsi conferences ( #8286 )
This could be customised to trigger a different kind of notification in the future, but for now it's a normal non-highlight one.
3 years ago
Patrick Cloke
34a5696f93
Fix typos and spelling errors. ( #8639 )
3 years ago
Brendan Abolivier
dd11f575a2
Incorporate review
3 years ago
Brendan Abolivier
60328ce9fb
Lint
3 years ago
Brendan Abolivier
9725c59247
Implement new experimental push rules with a database hack to enable them
3 years ago
Erik Johnston
2e697d3013
Explicitly check that tombstone is a state event before notifying.
4 years ago
J. Ryan Stinnett
9b1b79f3f5
Add default push rule to ignore reactions ( #5623 )
This adds a default push rule following the proposal in
[MSC2153](https://github.com/matrix-org/matrix-doc/pull/2153 ).
See also https://github.com/vector-im/riot-web/issues/10208
See also https://github.com/matrix-org/matrix-js-sdk/pull/976
4 years ago
Amber Brown
32e7c9e7f2
Run Black. ( #5482 )
4 years ago
Travis Ralston
8c5b1e30d4
Add a default .m.rule.tombstone push rule ( #4867 )
* Add a default .m.rule.tombstone push rule
In support of MSC1930: https://github.com/matrix-org/matrix-doc/pull/1930
* changelog
* Appease the changelog linter
5 years ago
Amber Brown
49af402019
run isort
5 years ago
Amber Brown
c936a52a9e
Consistently use six's iteritems and wrap lazy keys/values in list() if they're not meant to be lazy ( #3307 )
6 years ago
David Baker
9342bcfce0
Omit the *s for @room notifications
They're just redundant
6 years ago
David Baker
0f1eb3e914
Use notification levels in power_levels
Rather than making the condition directly require a specific power
level. This way the level require to notify a room can be configured
per room.
6 years ago
David Baker
985ce80375
They're called rooms
6 years ago
David Baker
b9b9714fd5
Get rule type right
6 years ago
David Baker
fa969cfdde
Support for channel notifications
Add condition type to check the sender's power level and add a base
rule using it for @channel notifications.
6 years ago
Erik Johnston
49cf205dc7
_id field must uniquely identify different conditions
7 years ago
Matthew Hodgson
3f6ec271ba
proposal for notifying on e2e events
7 years ago
David Baker
1594eba29e
s/underride/override/ in the rule_id too
7 years ago
David Baker
1c7c317df1
Move display name rule
As per https://github.com/matrix-org/matrix-doc/pull/373 and comment
7 years ago
Mark Haines
790f5848b2
Fix the rule_id for .m.rule.invite_for_me ( #715 )
8 years ago
David Baker
ed3979df5f
Fix invite pushes
* If the event is an invite event, add the invitee to list of user we run push rules for (if they have a pusher etc)
* Move invite_for_me to be higher prio than member events otherwise member events matches them
* Spell override right
8 years ago
Mark Haines
2a37467fa1
Use google style doc strings.
pycharm supports them so there is no need to use the other format.
Might as well convert the existing strings to reduce the risk of
people accidentally cargo culting the wrong doc string format.
8 years ago
David Baker
3b554bda26
Never notify for member events. This fixes https://github.com/vector-im/vector-web/issues/828
8 years ago
Mark Haines
de27f7fc79
Add support for changing the actions for default rules
See matrix-org/matrix-doc#283
Works by adding dummy rules to the push rules table with a negative priority class and then using those rules to clobber the default rule actions when adding the default rules in ``list_with_base_rules``
8 years ago
David Baker
766c24b2e6
Only notify for messages in one to one rooms, not every event
Fixes the fact that candidate events and hangups generated notifications.
8 years ago
David Baker
930ba003f8
Remove member event rule as per SYN-607
8 years ago
Erik Johnston
f750a442f7
Update _id
8 years ago
Erik Johnston
866fe27e78
Do for loop once at start
8 years ago
Erik Johnston
d1f56f732e
Use static for const dicts
8 years ago
Mark Haines
9c1f853d58
Rename 'user_name' to 'user_id' in push to make it consistent with the rest of the code
8 years ago
David Baker
d9db819e23
Change default pushrules back to notifying for all messages.
8 years ago
Matthew Hodgson
6c28ac260c
copyrights
8 years ago
David Baker
4b1281f9b7
Change the m.room.message rule to be disabled by default so we only notify for 1:1 rooms / highlights out-of-the-box
8 years ago
David Baker
6825eef955
Oops: underride rule had an identifier with override in it.
9 years ago
David Baker
ed83638668
Make one-to-one rule an underride otherwise bings don't work in one-to-one wrooms. Likewise a couple of other rules.
9 years ago
Mark Haines
4e2f8b8722
Copyright notices
9 years ago
David Baker
465354ffde
'false' is not False
9 years ago
David Baker
83b1e7fb3c
PEP8 blank lines
9 years ago
David Baker
04f8478aaa
Add the master push rule for the break-my-push button. Allow server default rules to be disabled by default.
9 years ago