Apply the pusher http hack in the right place (#4692)
Do it in the constructor, so that it works for badge updates as well as pushespull/4767/head
parent
776fe6c184
commit
085d69b0bd
|
@ -86,6 +86,10 @@ class HttpPusher(object):
|
||||||
"'url' required in data for HTTP pusher"
|
"'url' required in data for HTTP pusher"
|
||||||
)
|
)
|
||||||
self.url = self.data['url']
|
self.url = self.data['url']
|
||||||
|
self.url = self.url.replace(
|
||||||
|
"https://matrix.org/_matrix/push/v1/notify",
|
||||||
|
"http://http-priv.matrix.org/_matrix/push/v1/notify",
|
||||||
|
)
|
||||||
self.http_client = hs.get_simple_http_client()
|
self.http_client = hs.get_simple_http_client()
|
||||||
self.data_minus_url = {}
|
self.data_minus_url = {}
|
||||||
self.data_minus_url.update(self.data)
|
self.data_minus_url.update(self.data)
|
||||||
|
@ -332,12 +336,7 @@ class HttpPusher(object):
|
||||||
if not notification_dict:
|
if not notification_dict:
|
||||||
defer.returnValue([])
|
defer.returnValue([])
|
||||||
try:
|
try:
|
||||||
url = self.url.replace(
|
resp = yield self.http_client.post_json_get_json(self.url, notification_dict)
|
||||||
"https://matrix.org/_matrix/push/v1/notify",
|
|
||||||
"http://http-priv.matrix.org/_matrix/push/v1/notify",
|
|
||||||
)
|
|
||||||
|
|
||||||
resp = yield self.http_client.post_json_get_json(url, notification_dict)
|
|
||||||
except Exception:
|
except Exception:
|
||||||
logger.warn(
|
logger.warn(
|
||||||
"Failed to push event %s to %s",
|
"Failed to push event %s to %s",
|
||||||
|
|
Loading…
Reference in New Issue