Dan Callahan
d7141e0b8b
Fix Shellcheck SC2006: Use $(...) notation
Use $(...) notation instead of legacy backticked `...`.
https://github.com/koalaman/shellcheck/wiki/SC2006
Signed-off-by: Dan Callahan <danc@element.io>
2 years ago
Dan Callahan
13f084eb58
Fix Shellcheck SC2086: Quote to prevent splitting
Double quote to prevent globbing and word splitting.
https://github.com/koalaman/shellcheck/wiki/SC2086
Signed-off-by: Dan Callahan <danc@element.io>
2 years ago
Dan Callahan
64adbb7b54
Fix Shellcheck SC2046: Quote to prevent word split
Quote this to prevent word splitting
https://www.shellcheck.net/wiki/SC2046
Signed-off-by: Dan Callahan <danc@element.io>
2 years ago
Dan Callahan
12d79ff1b6
Fix Shellcheck SC2164: exit in case cd fails.
Use `cd ... || exit` in case cd fails.
https://github.com/koalaman/shellcheck/wiki/SC2164
Signed-off-by: Dan Callahan <danc@element.io>
2 years ago
Richard van der Hoff
8078dec3be
Fix exit code for `check_line_terminators.sh` ( #7970 )
If there are *no* files with CRLF line endings, then the xargs exits with a
non-zero exit code (as expected), but then, since that is the last thing to
happen in the script, the script as a whole exits non-zero, making the whole
thing fail.
using `if/then/fi` instead of `&& (...)` means that the script exits with a
zero exit code.
3 years ago
Andrew Morgan
c4ce0da6fe
Add script for finding files with unix line terminators ( #7965 )
This PRs adds a script to check for unix-line terminators in the repo. It will be used to address https://github.com/matrix-org/synapse/issues/7943 by adding the check to CI.
I've changed the original script slightly as proposed in https://github.com/matrix-org/pipelines/pull/81#discussion_r460580664
3 years ago
Richard van der Hoff
473d3801b6
Cleanups and additions to the module API
Add some useful things, such as error types and logcontext handling, to the
API.
Make `hs` a private member to dissuade people from using it (hopefully
they aren't already).
Add a couple of new methods (`record_user_external_id` and
`generate_short_term_login_token`).
4 years ago
David Baker
d549fdfa22
Remove code that's now been obsoleted or moved elsewhere
8 years ago
Erik Johnston
b6507869cd
Make get_invites return RoomsForUser
8 years ago
Mark Haines
7076082ae6
Fix relative imports so they work in both py3 and py27
8 years ago
Mark Haines
b9977ea667
Remove dead code for setting device specific rules.
It wasn't possible to hit the code from the API because of a typo
in parsing the request path. Since no-one was using the feature
we might as well remove the dead code.
8 years ago
Erik Johnston
31a2b892d8
Revert to putting it around the entire block
8 years ago
Erik Johnston
549698b1e0
Don't measure across event stream call, as it lasts for a long time.
8 years ago
Erik Johnston
2c1fbea531
Fix up logcontexts
8 years ago
Erik Johnston
13e6262659
Add metrics to pushers
8 years ago
Erik Johnston
771528ab13
Change event_push_actions_rm_tokens schema
8 years ago
Erik Johnston
53cb173663
Push: Use storage apis that are cached
8 years ago
Erik Johnston
0e07f2e15d
Only fetch events for rooms and receipts
8 years ago
Erik Johnston
3a00f13436
Only compute badge count when necessary.
This reverts commit d726597737
.
8 years ago
David Baker
3fa344c037
Add storage function to get all receipts for a user. Also add some cache invalidation to the receipts storage because there wasn't any, and remove a method that was unused.
8 years ago
David Baker
7cc047455e
Inline membership specifier
8 years ago
David Baker
d726597737
Simplify badge updating code by just updating it every time we get woken up and it's not an event
8 years ago
David Baker
12623c99b6
Use the unread notification count to send accurate badge counts in push notifications.
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
Matthew Hodgson
6c28ac260c
copyrights
8 years ago
David Baker
c914d67cda
Rename event-actions to event_push_actions as per PR request
8 years ago
David Baker
9b4cd0cd0f
pep8 & unused variable
8 years ago
David Baker
5645d9747b
Add some comments to areas that could be optimised.
8 years ago
David Baker
5e909c73d7
Store nothing instead of ['dont_notify'] for events with no notification required: much as it would be nice to be able to tell between the event not having been processed and there being no notification for it, this isn't worth filling up the table with ['dont_notify'] I think. Consequently treat the empty actions array as dont_notify and filter dont_notify out of the result.
8 years ago
David Baker
a24eedada7
pep8
8 years ago
David Baker
4a728beba1
Split out the push rule evaluator into a separate file so it can be more readily reused. Should be functionally identical.
8 years ago
David Baker
91482cd6a0
Use raw string for regex here, otherwise \b is the backspace character. Fixes displayname matching.
8 years ago
Erik Johnston
f8f3d72e2b
Don't make pushers handle presence/typing events
8 years ago
Erik Johnston
78fa346b07
Store the 'last_token' in the db, even if we processed no events
8 years ago
Erik Johnston
a45ec7c651
Block on storing the current last_tokens
8 years ago
David Baker
b8690dd840
Catch any exceptions in the pusher loop. Use a lower timeout for pushers so we can see if they're actually still running.
9 years ago
Mark Haines
00dd207f60
Take a dict of the rule, not the rule list
9 years ago
Mark Haines
804b732aab
SYN-390: Don't modify the dictionary returned from the database here either
9 years ago
Mark Haines
2043527b9b
Don't try to use a txn when not in one, remove spurious debug logging
9 years ago
Mark Haines
53447e9cd3
Add caches for things requested by the pushers
9 years ago
Mark Haines
d61ce3f670
Add a cache for get_current_state with state_key
9 years ago
David Baker
c1a256cc4c
Allow multiple pushers for a single app ID & pushkey, honouring the 'append' flag in the API.
9 years ago
David Baker
bbb010a30f
More sacrifices to the pep8 gods.
9 years ago
David Baker
c92fdf88a3
Log the matching push rule.
9 years ago
David Baker
cdb2e045ee
Again, underscore, not hyphen
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
David Baker
c06b45129c
Add more server default rules so we have default rules for whether you get notifs for invites / random member events
9 years ago
David Baker
657a0d2568
Comment typo
9 years ago
David Baker
6fab7bd2c1
s/user_name/user/ as per mjark's comment
9 years ago
David Baker
cfac3b7873
SYN-267 Add a fallback rule as an explicit server default rule and make the default dont-notify so you effectively have a "notify for everything else" switch you can turn on and off.
9 years ago