Commit Graph

3662 Commits

Author SHA1 Message Date
Erik Johnston
7959e8b764 Underscores are allowed in user ids 2016-01-22 14:59:49 +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
David Baker
7cd418d38e Don't add the member functiopn if we're not using treecache 2016-01-22 13:40:37 +00:00
David Baker
cd80019eec docs 2016-01-22 12:21:13 +00:00
David Baker
d552861346 Revert all the bits changing keys of eeverything that used LRUCaches to tuples 2016-01-22 12:18:14 +00:00
David Baker
10f76dc5da Make LRU cache not default to treecache & add options to use it 2016-01-22 12:10:33 +00:00
David Baker
5b142788d2 Add __contains__ 2016-01-22 11:49:59 +00:00
David Baker
eaa836e8ca Docs for treecache 2016-01-22 11:47:22 +00:00
David Baker
42eae4634f Use new invalidate_many cache invalidation to invalidate the event_push_actions cache appropriately. 2016-01-22 11:22:48 +00:00
David Baker
8acc5cb60f Add invalidate_many here too 2016-01-22 11:22:32 +00:00
Erik Johnston
975903ae17 Sanitize filters 2016-01-22 10:41:30 +00:00
David Baker
330be18ec5 peppate 2016-01-21 19:17:32 +00:00
David Baker
f1f8122120 Change LRUCache to be tree-based so we can delete subtrees. 2016-01-21 19:16:25 +00:00
Erik Johnston
0e07f2e15d Only fetch events for rooms and receipts 2016-01-21 16:10:37 +00:00
Erik Johnston
8f66fe6392 Cache get_unread_event_push_actions_by_room_for_user 2016-01-21 15:02:07 +00:00
Erik Johnston
3a00f13436 Only compute badge count when necessary.
This reverts commit d726597737.
2016-01-21 14:56:11 +00:00
Erik Johnston
c6549117a2 Fix AttributeError 2016-01-21 14:02:14 +00:00
Erik Johnston
ed1d189e10 Merge pull request #515 from matrix-org/erikj/syn-606
SYN-606: Peeking does not wake up /events
2016-01-21 13:40:20 +00:00
Erik Johnston
dfe1273d14 Merge pull request #509 from matrix-org/erikj/dns_cache
Cache dns lookups, and use the cache if we fail to lookup servers later
2016-01-21 13:37:23 +00:00
Erik Johnston
91a222c66d SYN-606: Peeking does not wake up /events
If a real user attempted to first peek into one room, and then another,
their room event stream would not be woken up for events in the later
room.
2016-01-21 13:22:26 +00:00
David Baker
930ba003f8 Remove member event rule as per SYN-607 2016-01-21 11:50:27 +00:00
David Baker
c1a3021771 Merge pull request #507 from matrix-org/push_badge_counts
Push badge counts
2016-01-21 10:09:11 +00:00
Erik Johnston
d049e81b10 Merge pull request #513 from matrix-org/erikj/register_user_chars
Don't explode when given a unicode username in /register/
2016-01-21 09:53:35 +00:00
Erik Johnston
c43b6dcc75 Fix change_password 2016-01-20 16:14:48 +00:00
David Baker
367cfab4e6 peppate 2016-01-20 16:05:09 +00:00
Erik Johnston
73ca8e5834 Whine if we give a from param to /sync 2016-01-20 15:42:57 +00:00
Erik Johnston
b088291f14 Don't explode when given a unicode username in /register/ 2016-01-20 15:40:25 +00:00
Daniel Wagner-Hall
da417aa56d Allow non-guests to peek on rooms using /events 2016-01-20 15:34:07 +00:00
David Baker
d4315bbf6b Add index by user id on receipts_linearized 2016-01-20 15:33: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
ccf9387d57 Merge branch 'develop' into push_badge_counts 2016-01-20 13:33:45 +00:00
David Baker
259d1ecd1d Don't generate push actions for our own events 2016-01-20 13:24:59 +00:00
Erik Johnston
191070123d Cache dns lookups, and use the cache if we fail to lookup servers later 2016-01-20 11:34:09 +00:00
David Baker
afb7b377f2 Merge branch 'develop' into push_badge_counts 2016-01-19 18:17:23 +00:00
Erik Johnston
af30140621 Merge pull request #506 from matrix-org/erikj/push_fast
Only compute unread notifications for rooms we send down stream
2016-01-19 17:31:10 +00:00
Erik Johnston
ac2842ff1e Only compute unread notifications for rooms we send down stream 2016-01-19 17:19:53 +00:00
Erik Johnston
892ee473d9 Don't use form of get_state_for_events with None state_key 2016-01-19 17:14:46 +00:00
Erik Johnston
2818a000aa Use split rather than endswith 2016-01-19 16:11:39 +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
7a079adc8f Merge pull request #477 from matrix-org/erikj/access_token_log
Don't log urlencoded access_tokens
2016-01-19 14:28:29 +00:00
Erik Johnston
b8518ffe65 Use all_ephemeral_by_room in incremental_sync_with_gap_for_room 2016-01-19 14:26:58 +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
05f78b3b52 Merge pull request #504 from matrix-org/erikj/highlight_count
Return highlight_count in /sync
2016-01-19 13:21:48 +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
3adcc4c86a Return highlight_count in /sync 2016-01-19 11:35:50 +00:00
Erik Johnston
47e7963e50 Merge pull request #502 from matrix-org/erikj/push_notif_perf
Unread notification performance.
2016-01-19 11:27:27 +00:00
Erik Johnston
0d241e1114 Take a deepcopy of push rules before mutating them 2016-01-19 10:15:12 +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
5cd2126a6a Remove dead code 2016-01-18 16:49:46 +00:00
Erik Johnston
29c353c553 Don't split at word boundaries, actually use regex 2016-01-18 16:48:17 +00:00
Daniel Wagner-Hall
808a8aedab Don't error on AS non-ghost user use
This will probably go away either when we fix our existing ASes, or when
we kill the concept of non-ghost users.
2016-01-18 16:33:05 +00:00
Daniel Wagner-Hall
74474a6d63 Pull out app service user lookup
I find this a lot simpler than nested try-catches and stuff
2016-01-18 16:32:33 +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
0e39dcd135 Remove internal ids 2016-01-18 14:50:17 +00:00
Erik Johnston
345ff2196a Don't edit ruleset 2016-01-18 14:50:17 +00:00
Erik Johnston
2c176e02ae Make unit tests work 2016-01-18 14:48:50 +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
Erik Johnston
2068678b8c Make Event objects behave more like dicts 2016-01-18 14:43:50 +00:00
Erik Johnston
cc66a9a5e3 Allow filtering events for multiple users at once 2016-01-18 14:43:50 +00:00
Daniel Wagner-Hall
ac5a4477ad Require unbanning before other membership changes 2016-01-15 16:27:26 +00:00
Daniel Wagner-Hall
b5ce4f0427 Remove unused parameters 2016-01-15 13:54:03 +00:00
David Baker
5819b7a78c M_INVALID_USERNAME to be consistent with the parameter name 2016-01-15 10:06:34 +00:00
David Baker
3f8db3d597 Add specific error code for invalid user names. 2016-01-14 17:21:04 +00:00
Erik Johnston
a50013fd99 Merge pull request #497 from matrix-org/erikj/max_limit
Clamp pagination limits to at most 1000
2016-01-14 16:28:52 +00:00
Richard van der Hoff
2978053d16 Merge branch 'release-v0.12.1' into develop 2016-01-14 15:04:08 +00:00
Daniel Wagner-Hall
2680043bc6 Require ID and as_token be unique for ASs
Defaults ID to as_token if not specified. This will change
when IDs are fully supported.
2016-01-14 14:34:01 +00:00
David Baker
8db451f652 Merge pull request #498 from matrix-org/push_rule_enabled_fix
Fix enabling & disabling push rules
2016-01-14 13:34:05 +00:00
Daniel Wagner-Hall
d14fcfd24a Merge pull request #487 from matrix-org/daniel/forceregistration
Require AS users to be registered before use
2016-01-14 11:06:43 +00:00
Daniel Wagner-Hall
27927463a1 Merge pull request #494 from matrix-org/daniel/2
Don't start server if ASes are invalidly configured
2016-01-14 11:06:19 +00:00
Daniel Wagner-Hall
fcb6df45e5 Merge pull request #493 from matrix-org/daniel/1
Delete unused code
2016-01-14 11:06:14 +00:00
David Baker
a7927c13fd Fix enabling & disabling push rules 2016-01-14 10:53:44 +00:00
Erik Johnston
339c8f0133 Clamp pagination limits to at most 1000 2016-01-14 10:22:02 +00:00
Erik Johnston
bce602eb4e Use logger not logging 2016-01-14 09:56:26 +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
2655d61d70 Don't change signature. Return empty list 2016-01-13 17:43:39 +00:00
Erik Johnston
fcb05b4c82 Temporarily disable notification branch 2016-01-13 17:39:58 +00:00
Daniel Wagner-Hall
f6fcff3602 Don't start server if ASes are invalidly configured 2016-01-13 17:09:24 +00:00
Daniel Wagner-Hall
244b356a37 Delete unused code 2016-01-13 17:03:58 +00:00
Richard van der Hoff
49f33f6438 Add 'event' result to 'context' endpoint
... because the context isn't much use without the event.
2016-01-13 16:42:14 +00:00
Daniel Wagner-Hall
93afb40cd4 Skip, rather than erroring, invalid guest requests
Erroring causes problems when people make illegal requests, because they
don't know what limit parameter they should pass.

This is definitely buggy. It leaks message counts for rooms people don't
have permission to see, via tokens. But apparently we already
consciously decided to allow that as a team, so this preserves that
behaviour.
2016-01-13 16:41:42 +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
Daniel Wagner-Hall
7d09ab8915 Require AS users to be registered before use 2016-01-13 13:19:47 +00:00
David Baker
d9db819e23 Change default pushrules back to notifying for all messages. 2016-01-13 13:15:53 +00:00
Erik Johnston
44b4fc5f50 Use compiled regex 2016-01-13 11:47:32 +00:00
Mark Haines
f4dad9f639 Merge remote-tracking branch 'origin/erikj/bulk_get_push_rules' into markjh/table_name
Conflicts:
	synapse/storage/push_rule.py
2016-01-13 11:46:07 +00:00
Erik Johnston
8740e4e94a bulk_get_push_rules should handle empty lists 2016-01-13 11:37:17 +00:00
Mark Haines
c0a279e808 Delete the table objects from TransactionStore 2016-01-13 11:15:20 +00:00
Mark Haines
96e400fee5 Remove the RoomsTable object 2016-01-13 11:07:32 +00:00
Erik Johnston
72ba26679b Merge pull request #480 from matrix-org/erikj/guest_event_tightloop
Dont fire user_joined_room when guest hits /events
2016-01-13 11:00:50 +00:00
Erik Johnston
70dfe4dc96 Don't include old left rooms 2016-01-12 15:01:56 +00:00
Mark Haines
a8e9e0b916 Remove the PushersTable and EventPushActionsTable objects 2016-01-12 14:41:26 +00:00
Mark Haines
31de2953a3 Remove the PushRuleTable and PushRuleEnableTable objects 2016-01-12 14:36:16 +00:00
Erik Johnston
fd5c28dc52 Dont fire user_joined_room when guest hits /events
Firing the 'user_joined_room' signal everytime a guest hits /events
causes all presence for that room to be returned in the stream. This may
sound helpful, but causes clients to tightloop calling /events.

In general, guest users should get the initial presence from (room)
intial sync and so we don't require presence to sbsequently come down
the event stream.
2016-01-12 11:04:06 +00:00
Daniel Wagner-Hall
42aa1f3f33 Merge pull request #478 from matrix-org/daniel/userobject
Introduce a User object

I'm sick of passing around more and more things as tuple items around
the whole world, and needing to edit every call site every time there is
more information about a user. So pass them around together as an
object.

This object has incredibly poorly named fields because we have a
convention that `user` indicates a UserID object, and `user_id`
indicates a string. I tried to clean up the whole repo to fix this, but
gave up. So instead, I introduce a second convention. A user_object is a
User, and a user_id_object is a UserId. I may have cried a little bit.
2016-01-11 17:50:22 +00:00
Daniel Wagner-Hall
2110e35fd6 Introduce a Requester object
This tracks data about the entity which made the request. This is
instead of passing around a tuple, which requires call-site
modifications every time a new piece of optional context is passed
around.

I tried to introduce a User object. I gave up.
2016-01-11 17:48:45 +00:00
David Baker
b5d33a656f Postgres doesn't like booleans 2016-01-11 17:13:52 +00:00
David Baker
fe56138142 Remove rogue 'admin' 2016-01-11 17:09:03 +00:00
Erik Johnston
8f8b884430 Don't log urlencoded access_tokens 2016-01-08 17:48:08 +00:00
Erik Johnston
29e595e5d4 Merge pull request #474 from matrix-org/erikj/core_dump
Turn on core dumps
2016-01-08 16:52:15 +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
Mark Haines
8677b7d698 Only use cropped thumbnails when asked for a cropped thumbnail.
Even though ones cropped with scale might be technically valid.
2016-01-07 18:57:15 +00:00
Erik Johnston
33bef689c1 Turn on core dumps 2016-01-07 15:34:30 +00:00
Erik Johnston
fcbe63eaad Use logger not logging 2016-01-07 15:28:17 +00:00
Erik Johnston
5727922106 Merge pull request #473 from matrix-org/erikj/ssh_manhole
Change manhole to use ssh
2016-01-07 14:36:16 +00:00
Erik Johnston
5dc5e29b9c s/telnet/ssh/ 2016-01-07 14:02:57 +00:00
Erik Johnston
c9ae1d1ee5 Change manhole to use ssh 2016-01-07 13:59:02 +00:00
David Baker
daadcf36c0 This comma is actually important 2016-01-07 10:15:35 +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
Matthew Hodgson
49c34dfd36 Merge pull request #472 from roblabla/patch-1
Config Comment mixup in captcha public/private key
2016-01-06 22:24:28 +00:00
Robin Lambertz
4106477e7f Config Comment mixup in captcha public/private key 2016-01-06 23:19:33 +01:00
Daniel Wagner-Hall
11a974da21 Add /_matrix/versions to report supported versions 2016-01-06 18:08:52 +00:00
David Baker
09dc9854cd comma style 2016-01-06 17:44:10 +00:00
David Baker
442fcc02f7 Merge remote-tracking branch 'origin/develop' into store_event_actions 2016-01-06 17:28:55 +00:00
David Baker
b6a585348a Adding is_guest here won't work because it just constructs a dict of uid -> password hash 2016-01-06 17:16:02 +00:00
Mark Haines
4cec90a260 Pass whether the user was a guest to some of the event streams 2016-01-06 16:54:57 +00:00
Mark Haines
392773ccb2 Guest users must be joined to a room to see it in /sync 2016-01-06 16:44:13 +00:00
Daniel Wagner-Hall
bf32922e5a Log when starting stats reporting 2016-01-06 14:13:34 +00:00
Daniel Wagner-Hall
797691f908 Log on stats scheduling 2016-01-06 14:04:27 +00:00
Daniel Wagner-Hall
5880de186b Log when we skip daily messages 2016-01-06 13:52:16 +00:00
David Baker
992928304f Delete notifications for redacted events 2016-01-06 11:58:46 +00:00
David Baker
ae1262a241 Add schema change file for is_guest flag 2016-01-06 11:58:20 +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
eb03625626 Merge remote-tracking branch 'origin/develop' into store_event_actions 2016-01-05 18:39:50 +00:00
Daniel Wagner-Hall
2ef6de928d Skip, rather than erroring, invalid guest requests
Erroring causes problems when people make illegal requests, because they
don't know what limit parameter they should pass.

This is definitely buggy. It leaks message counts for rooms people don't
have permission to see, via tokens. But apparently we already
consciously decided to allow that as a team, so this preserves that
behaviour.
2016-01-05 18:12:37 +00:00
Daniel Wagner-Hall
cfd07aafff Allow guests to upgrade their accounts 2016-01-05 18:01:18 +00:00
Erik Johnston
8737ead008 Use larger thumbnail rather than smaller. 2016-01-05 17:30:30 +00:00
Erik Johnston
acb19068d0 Return /sync when something under the 'leave' key has changed 2016-01-05 14:49:06 +00:00
David Baker
85ca8cb90c comment typo 2016-01-05 13:32:39 +00:00
Erik Johnston
c3ea36304b Use named args 2016-01-05 12:57:45 +00:00
Erik Johnston
1b5642604b Support inviting 3pids in /createRoom 2016-01-05 11:56:21 +00:00
David Baker
4eb7b950c8 = not == in sql 2016-01-04 18:11:17 +00:00
David Baker
c77e7e60fc Only joined rooms have unread_notif_count 2016-01-04 15:49:06 +00:00
David Baker
d74c6ace24 comma 2016-01-04 15:32:00 +00:00
David Baker
f1b67730fa Add unread_notif_count in incremental_sync_with_gap 2016-01-04 14:50:36 +00:00