Imported Upstream version 0.22.1
Erik Johnston
6 years ago
0 | Changes in synapse v0.22.1 (2017-07-06) | |
1 | ======================================= | |
2 | ||
3 | Bug fixes: | |
4 | ||
5 | * Fix bug where pusher pool didn't start and caused issues when | |
6 | interacting with some rooms (PR #2342) | |
7 | ||
8 | ||
0 | 9 | Changes in synapse v0.22.0 (2017-07-06) |
1 | 10 | ======================================= |
2 | 11 |
15 | 15 | """ This is a reference implementation of a Matrix home server. |
16 | 16 | """ |
17 | 17 | |
18 | __version__ = "0.22.0" | |
18 | __version__ = "0.22.1" |
75 | 75 | self.keyring = hs.get_keyring() |
76 | 76 | self.action_generator = hs.get_action_generator() |
77 | 77 | self.is_mine_id = hs.is_mine_id |
78 | self.pusher_pool = hs.get_pusherpool() | |
78 | 79 | |
79 | 80 | self.replication_layer.set_handler(self) |
80 | 81 | |
1425 | 1426 | if not backfilled: |
1426 | 1427 | # this intentionally does not yield: we don't care about the result |
1427 | 1428 | # and don't need to wait for it. |
1428 | preserve_fn(self.hs.get_pusherpool().on_new_notifications)( | |
1429 | preserve_fn(self.pusher_pool.on_new_notifications)( | |
1429 | 1430 | event_stream_id, max_stream_id |
1430 | 1431 | ) |
1431 | 1432 |
48 | 48 | self.validator = EventValidator() |
49 | 49 | |
50 | 50 | self.pagination_lock = ReadWriteLock() |
51 | ||
52 | self.pusher_pool = hs.get_pusherpool() | |
51 | 53 | |
52 | 54 | # We arbitrarily limit concurrent event creation for a room to 5. |
53 | 55 | # This is to stop us from diverging history *too* much. |
609 | 611 | |
610 | 612 | # this intentionally does not yield: we don't care about the result |
611 | 613 | # and don't need to wait for it. |
612 | preserve_fn(self.hs.get_pusherpool().on_new_notifications)( | |
614 | preserve_fn(self.pusher_pool.on_new_notifications)( | |
613 | 615 | event_stream_id, max_stream_id |
614 | 616 | ) |
615 | 617 |
72 | 72 | def __init__(self, hs): |
73 | 73 | super(PushersSetRestServlet, self).__init__(hs) |
74 | 74 | self.notifier = hs.get_notifier() |
75 | self.pusher_pool = self.hs.get_pusherpool() | |
75 | 76 | |
76 | 77 | @defer.inlineCallbacks |
77 | 78 | def on_POST(self, request): |
80 | 81 | |
81 | 82 | content = parse_json_object_from_request(request) |
82 | 83 | |
83 | pusher_pool = self.hs.get_pusherpool() | |
84 | ||
85 | 84 | if ('pushkey' in content and 'app_id' in content |
86 | 85 | and 'kind' in content and |
87 | 86 | content['kind'] is None): |
88 | yield pusher_pool.remove_pusher( | |
87 | yield self.pusher_pool.remove_pusher( | |
89 | 88 | content['app_id'], content['pushkey'], user_id=user.to_string() |
90 | 89 | ) |
91 | 90 | defer.returnValue((200, {})) |
108 | 107 | append = content['append'] |
109 | 108 | |
110 | 109 | if not append: |
111 | yield pusher_pool.remove_pushers_by_app_id_and_pushkey_not_user( | |
110 | yield self.pusher_pool.remove_pushers_by_app_id_and_pushkey_not_user( | |
112 | 111 | app_id=content['app_id'], |
113 | 112 | pushkey=content['pushkey'], |
114 | 113 | not_user_id=user.to_string() |
115 | 114 | ) |
116 | 115 | |
117 | 116 | try: |
118 | yield pusher_pool.add_pusher( | |
117 | yield self.pusher_pool.add_pusher( | |
119 | 118 | user_id=user.to_string(), |
120 | 119 | access_token=requester.access_token_id, |
121 | 120 | kind=content['kind'], |
151 | 150 | self.hs = hs |
152 | 151 | self.notifier = hs.get_notifier() |
153 | 152 | self.auth = hs.get_v1auth() |
153 | self.pusher_pool = self.hs.get_pusherpool() | |
154 | 154 | |
155 | 155 | @defer.inlineCallbacks |
156 | 156 | def on_GET(self, request): |
160 | 160 | app_id = parse_string(request, "app_id", required=True) |
161 | 161 | pushkey = parse_string(request, "pushkey", required=True) |
162 | 162 | |
163 | pusher_pool = self.hs.get_pusherpool() | |
164 | ||
165 | 163 | try: |
166 | yield pusher_pool.remove_pusher( | |
164 | yield self.pusher_pool.remove_pusher( | |
167 | 165 | app_id=app_id, |
168 | 166 | pushkey=pushkey, |
169 | 167 | user_id=user.to_string(), |