Commit Graph

66 Commits

Author SHA1 Message Date
David Baker
c914d67cda Rename event-actions to event_push_actions as per PR request 2016-01-04 14:05:37 +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
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
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
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
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
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
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
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
c06b45129c Add more server default rules so we have default rules for whether you get notifs for invites / random member events 2015-03-06 11:50:51 +00:00
David Baker
657a0d2568 Comment typo 2015-03-06 11:34:30 +00:00
David Baker
6fab7bd2c1 s/user_name/user/ as per mjark's comment 2015-03-02 18:17:19 +00:00
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. 2015-02-26 18:58:14 +00:00
David Baker
94fa334b01 Add enable/disable overlay for push rules (REST API not yet hooked up) 2015-02-25 19:17:07 +00:00
David Baker
8d5cce62ab Update pushers by app id and pushkey, not user id and pushkey 2015-02-13 16:16:16 +00:00
Erik Johnston
4ebbaf0d43 Blunty replace json with simplejson 2015-02-11 14:23:10 +00:00
Mark Haines
b085fac735 Code-style fixes 2015-02-10 16:30:48 +00:00
David Baker
8f616684a3 Need to use re.search if looking for matches not at the start of the string. Also comparisons with None should be 'is'. 2015-02-09 17:01:40 +00:00
Matthew Hodgson
a578251b48 only do word-boundary patches on bodies for now 2015-02-09 16:44:47 +00:00
Matthew Hodgson
ecb0f78063 glob *s should probably be non-greedy 2015-02-08 02:37:35 +00:00
Matthew Hodgson
c2afc2ad90 oops 2015-02-08 00:37:03 +00:00
Matthew Hodgson
8be07e0db4 kill off fnmatch in favour of word-boundary based push alerts (untested) 2015-02-08 00:34:34 +00:00
David Baker
2df41aa138 Server default rules now of all kinds rather than all being at lowest prio. 2015-02-05 14:46:37 +00:00
David Baker
dc7bb70f22 s/instance_handle/profile_tag/ 2015-02-03 16:51:07 +00:00
David Baker
9a71add1c0 Use set_tweak instead of set_sound 2015-02-03 16:06:31 +00:00
David Baker
0b354fcb84 Again, don't assume all member events have displayname. 2015-01-30 23:10:35 +00:00
David Baker
fe10b882b7 Don't assume all member events have a display nme. 2015-01-30 23:06:39 +00:00
David Baker
4ffac34a64 Add glob asterisks when running rules.
Means that now you can't do exact matches even in override rules,
but I think we can live with that. Advantage is that you'll now
always get back what was put in to the API.
2015-01-30 15:03:56 +00:00
David Baker
322a047502 Add room member count condition and default rule to make a noise on rooms of only 2 people. 2015-01-30 14:46:45 +00:00
David Baker
0b16886397 Change 'from' in notification pokes to 'sender' to match client API v2. Send sender display names where they exist. 2015-01-29 18:51:22 +00:00
David Baker
1235f7f383 Add default push rules including setting a sound for messages mentioning your username / display name 2015-01-29 18:38:22 +00:00
Mark Haines
acb68a39e0 Code style fixes. 2015-01-29 16:12:40 +00:00
David Baker
8b1dd9f57f Only send a badge-reset if the user actually has unread notifications. 2015-01-29 16:10:01 +00:00
David Baker
6fde707add doc style fix 2015-01-28 14:14:49 +00:00
David Baker
20c47383dc Oops, bad merge: needed to change the base class of the rest servlets too. 2015-01-28 14:10:46 +00:00
David Baker
03149ad23a More code style things 2015-01-28 14:01:24 +00:00
David Baker
e1ca0f1396 Brackets rather than slashes at end 2015-01-28 13:58:32 +00:00
David Baker
6df6f5e084 Redundant bracketing & missed space 2015-01-28 13:56:35 +00:00