Commit Graph

214 Commits (a611c968ccf93ddf50bdf003bb496006bcf42321)

Author SHA1 Message Date
David Baker 60965bd7e5 Revert b4a41aa542 as it's just broken. 2016-01-22 17:21:15 +00:00
David Baker 0e0e441b33 Merge pull request #522 from matrix-org/dbkr/no_push_unless_notify
Don't add notifications to the table unless there's actually a 'notify' action
2016-01-22 17:06:52 +00:00
David Baker b4a41aa542 Don't add notifications to the table unless there's actually a 'notify' action 2016-01-22 16:56:48 +00:00
Erik Johnston db6e26bb8c Don't mutate cached values 2016-01-22 16:03:55 +00:00
David Baker 7065b75bfd Don't crash if a user has no push rule enabled entries 2016-01-22 15:13:44 +00:00
David Baker 52bdd1b834 Overlay the push_rules_enabled map for users, otherwise they won't be able to disable server default rules. 2016-01-22 14:58:19 +00:00
Erik Johnston 0e07f2e15d Only fetch events for rooms and receipts 2016-01-21 16:10:37 +00:00
Erik Johnston 3a00f13436 Only compute badge count when necessary.
This reverts commit d726597737.
2016-01-21 14:56:11 +00:00
David Baker 930ba003f8 Remove member event rule as per SYN-607 2016-01-21 11:50:27 +00:00
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. 2016-01-20 15:30:31 +00:00
David Baker 7cc047455e Inline membership specifier 2016-01-20 13:50:28 +00:00
David Baker d726597737 Simplify badge updating code by just updating it every time we get woken up and it's not an event 2016-01-20 13:49:00 +00:00
David Baker 2309450a76 Merge branch 'develop' into push_badge_counts 2016-01-20 13:45:13 +00:00
David Baker 746f6e0eb3 'filtered' is a list of zero or 1 2016-01-20 13:44:04 +00:00
David Baker 7441d8cc0c Merge remote-tracking branch 'origin/develop' into push_badge_counts 2016-01-20 13:40:22 +00:00
David Baker 259d1ecd1d Don't generate push actions for our own events 2016-01-20 13:24:59 +00:00
David Baker afb7b377f2 Merge branch 'develop' into push_badge_counts 2016-01-19 18:17:23 +00:00
Erik Johnston fb5d8e58ff Change regex cache size to 5000 2016-01-19 16:07:07 +00:00
Erik Johnston 5a7d1ecffc Add regex cache. Only caculate push actions for users that have sent read receipts, and are on that server 2016-01-19 16:01:05 +00:00
Erik Johnston d056a0a3d8 Handle glob -> regex errors 2016-01-19 14:43:24 +00:00
Erik Johnston 9654ee0848 Return don't break 2016-01-19 14:24:59 +00:00
Erik Johnston 7ecd211163 Except truthy values 2016-01-19 14:22:02 +00:00
Erik Johnston 9a8949f022 Merge branch 'develop' of github.com:matrix-org/synapse into default_notify 2016-01-19 11:37:05 +00:00
Erik Johnston f750a442f7 Update _id 2016-01-19 10:14:53 +00:00
Erik Johnston 003853e702 Preserve truthiness 2016-01-18 17:34:02 +00:00
Erik Johnston a284ad4092 You need to escape backslashes 2016-01-18 17:20:44 +00:00
Erik Johnston 47f82e4408 Fix branch didn't check word_boundary 2016-01-18 17:04:36 +00:00
Erik Johnston 29c353c553 Don't split at word boundaries, actually use regex 2016-01-18 16:48:17 +00:00
Erik Johnston d16dcf642e Drop log levels 2016-01-18 15:44:04 +00:00
Erik Johnston 7dd14e5d1c Add comments and remove dead code 2016-01-18 15:42:23 +00:00
Erik Johnston 866fe27e78 Do for loop once at start 2016-01-18 15:29:41 +00:00
Erik Johnston d1f56f732e Use static for const dicts 2016-01-18 15:17:56 +00:00
Erik Johnston 345ff2196a Don't edit ruleset 2016-01-18 14:50:17 +00:00
Erik Johnston 63485b3029 Re-enable urnead notifications 2016-01-18 14:48:30 +00:00
Erik Johnston f59b564507 Make notifications go quicker 2016-01-18 14:48:29 +00:00
David Baker 12623c99b6 Use the unread notification count to send accurate badge counts in push notifications. 2016-01-13 18:55:57 +00:00
Erik Johnston fcb05b4c82 Temporarily disable notification branch 2016-01-13 17:39:58 +00:00
Mark Haines 9c1f853d58 Rename 'user_name' to 'user_id' in push to make it consistent with the rest of the code 2016-01-13 13:32:59 +00:00
David Baker d9db819e23 Change default pushrules back to notifying for all messages. 2016-01-13 13:15:53 +00:00
David Baker c232780081 Merge pull request #456 from matrix-org/store_event_actions
Send unread notification counts
2016-01-08 14:47:15 +00:00
David Baker 823b679232 more commas 2016-01-07 10:02:47 +00:00
Matthew Hodgson 6c28ac260c copyrights 2016-01-07 04:26:29 +00:00
David Baker 992928304f Delete notifications for redacted events 2016-01-06 11:58:46 +00:00
David Baker c79f221192 Add is_guest flag to users db to track whether a user is a guest user or not. Use this so we can run _filter_events_for_client when calculating event_push_actions. 2016-01-06 11:38:09 +00:00
David Baker 85ca8cb90c comment typo 2016-01-05 13:32:39 +00:00
David Baker c914d67cda Rename event-actions to event_push_actions as per PR request 2016-01-04 14:05:37 +00:00
David Baker 3051c9d002 Address minor PR issues 2016-01-04 13:39:29 +00:00
David Baker 9b4cd0cd0f pep8 & unused variable 2015-12-22 17:25:09 +00:00
David Baker 5645d9747b Add some comments to areas that could be optimised. 2015-12-22 17:19:22 +00:00
David Baker 4c8f6a7e42 Insert push actions in a single db query rather than one per user/profile_tag 2015-12-22 17:04:31 +00:00
David Baker 65c451cb38 Add bulk push rule evaluator which actually still evaluates rules one by one, but does far fewer db queries to fetch the rules 2015-12-22 15:19:34 +00:00
David Baker f73f154ec2 Only run pushers for users on this hs! 2015-12-21 15:28:54 +00:00
David Baker 42ad49f5b7 still very WIP, but now sends unread_notifications_count in the room object on sync (only actually corrrect in a full sync: hardcoded to 0 in incremental syncs). 2015-12-16 18:42:09 +00:00
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. 2015-12-10 18:40:28 +00:00
David Baker aa667ee396 Save event actions to the db 2015-12-10 17:51:15 +00:00
David Baker 21f135ba76 Very first cut of calculating actions for events as they come in. Doesn't store them yet. Not very efficient. 2015-12-10 16:26:08 +00:00
David Baker a24eedada7 pep8 2015-12-09 15:57:42 +00:00
David Baker 4a728beba1 Split out the push rule evaluator into a separate file so it can be more readily reused. Should be functionally identical. 2015-12-09 15:51:34 +00:00
Mark Haines 5dc09e82c4 Merge pull request #413 from matrix-org/markjh/reuse_http_client
Reuse a single http client, rather than creating new ones
2015-12-02 12:56:23 +00:00
Mark Haines 37b2d69bbc Reuse a single http client, rather than creating new ones 2015-12-02 11:36:02 +00:00
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 2015-12-02 11:26:49 +00:00
David Baker 91482cd6a0 Use raw string for regex here, otherwise \b is the backspace character. Fixes displayname matching. 2015-10-08 11:22:15 +01:00
Erik Johnston f8f3d72e2b Don't make pushers handle presence/typing events 2015-08-24 16:19:43 +01:00
Erik Johnston 78fa346b07 Store the 'last_token' in the db, even if we processed no events 2015-08-19 10:08:31 +01:00
Erik Johnston a45ec7c651 Block on storing the current last_tokens 2015-08-19 10:08:12 +01:00
Daniel Wagner-Hall 415c2f0549 Simplify LoginHander and AuthHandler
* Merge LoginHandler -> AuthHandler
 * Add a bunch of documentation
 * Improve some naming
 * Remove unused branches

I will start merging the actual logic of the two handlers shortly
2015-08-12 15:49:37 +01:00
David Baker 6825eef955 Oops: underride rule had an identifier with override in it. 2015-06-23 14:26:14 +01:00
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. 2015-06-05 11:40:22 +01:00
Mark Haines 00dd207f60 Take a dict of the rule, not the rule list 2015-05-26 14:57:48 +01:00
Mark Haines 804b732aab SYN-390: Don't modify the dictionary returned from the database here either 2015-05-26 10:35:08 +01:00
Mark Haines 2043527b9b Don't try to use a txn when not in one, remove spurious debug logging 2015-05-21 16:53:03 +01:00
Mark Haines 53447e9cd3 Add caches for things requested by the pushers 2015-05-21 16:41:39 +01:00
Mark Haines d61ce3f670 Add a cache for get_current_state with state_key 2015-05-21 16:41:39 +01:00
Erik Johnston 3e71d13acf Also log when we've started pushers 2015-04-29 18:37:42 +01:00
Erik Johnston c27d6ad6b5 Only start pushers when synapse has fully started 2015-04-29 18:25:24 +01:00
Erik Johnston 46daf2d200 Start pushers on reactor thread 2015-04-29 18:22:20 +01:00
David Baker 12d381bd5d Decode the data json in the storage layer (was moved but this part was missed) 2015-04-29 17:13:51 +01:00
Erik Johnston 327ca883ec Merge branch 'develop' of github.com:matrix-org/synapse into postgres 2015-04-28 13:39:42 +01:00
Mark Haines 9182f87664 Merge pull request #126 from matrix-org/csauth
Client / Server Auth Refactor
2015-04-28 11:00:27 +01:00
Erik Johnston 6f8e2d517e Merge branch 'develop' of github.com:matrix-org/synapse into postgres 2015-04-27 14:41:40 +01:00
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. 2015-04-24 14:27:17 +01:00
Mark Haines 4e2f8b8722 Copyright notices 2015-04-24 10:35:29 +01:00
Erik Johnston bc9e69e160 Move encoding and decoding of JSON into storage layer 2015-04-16 11:01:09 +01:00
David Baker 6f4f7e4e22 pep8 2015-03-26 14:12:06 +00:00
David Baker a32e876ef4 Delete pushers when changing password 2015-03-26 13:40:16 +00:00
David Baker df4c12c762 pep8 blank lines 2015-03-25 19:08:17 +00:00
David Baker c1a256cc4c Allow multiple pushers for a single app ID & pushkey, honouring the 'append' flag in the API. 2015-03-25 19:06:22 +00:00
David Baker c7023f2155 1) Pushers are now associated with an access token
2) Change places where we mean unauthenticated to 401, not 403, in C/S v2: hack so it stays as 403 in v1 because web client relies on it.
2015-03-24 17:24:15 +00:00
David Baker bbb010a30f More sacrifices to the pep8 gods. 2015-03-12 16:53:12 +00:00
David Baker c92fdf88a3 Log the matching push rule. 2015-03-11 22:17:31 +00:00
David Baker cdb2e045ee Again, underscore, not hyphen 2015-03-11 14:22:35 +00:00
David Baker 465354ffde 'false' is not False 2015-03-11 11:24:50 +00:00
David Baker 83b1e7fb3c PEP8 blank lines 2015-03-11 10:01:17 +00:00
David Baker 04f8478aaa Add the master push rule for the break-my-push button. Allow server default rules to be disabled by default. 2015-03-10 17:26:25 +00:00
David Baker 1df3ccf7ee D'oh: underscore, not hyphen 2015-03-09 12:39:56 +00:00
David Baker 118c883429 Call notifications should be override else they'll get clobbered by sender/room rules. 2015-03-06 19:41:36 +00:00
David Baker be9dafcd37 Dial down logging for failed pushers 2015-03-06 15:32:38 +00:00
David Baker 96eda876a4 Specify when we don't want to highlight 2015-03-06 15:12:37 +00:00
David Baker e7d7152c3c Remove the fallback rule - we probably don't want to be notifying for everything even if we don't know what it is. 2015-03-06 15:03:34 +00:00
David Baker 5ecc768970 Add attribute so push gateways can tell if a member event is about the user in question 2015-03-06 14:41:50 +00:00