mirror of
https://github.com/element-hq/synapse.git
synced 2024-12-19 09:31:35 +03:00
Include origin_server in the sig!
Also be consistent with underscores
This commit is contained in:
parent
4e12b10c7c
commit
1147ce7e18
1 changed files with 5 additions and 4 deletions
|
@ -89,19 +89,20 @@ class ProfileHandler(BaseHandler):
|
||||||
batch_rows = yield self.store.get_profile_batch(batchnum)
|
batch_rows = yield self.store.get_profile_batch(batchnum)
|
||||||
batch = {
|
batch = {
|
||||||
UserID(r["user_id"], self.hs.hostname).to_string(): {
|
UserID(r["user_id"], self.hs.hostname).to_string(): {
|
||||||
"displayname": r["displayname"],
|
"display_name": r["displayname"],
|
||||||
"avatar_url": r["avatar_url"],
|
"avatar_url": r["avatar_url"],
|
||||||
} for r in batch_rows
|
} for r in batch_rows
|
||||||
}
|
}
|
||||||
|
|
||||||
url = "https://%s/_matrix/federation/v1/replicate_profiles" % (host,)
|
url = "https://%s/_matrix/federation/v1/replicate_profiles" % (host,)
|
||||||
signed_batch = {
|
body = {
|
||||||
"batchnum": batchnum,
|
"batchnum": batchnum,
|
||||||
"signed_batch": sign_json(batch, self.hs.hostname, self.hs.config.signing_key[0]),
|
"batch": batch,
|
||||||
"origin_server": self.hs.hostname,
|
"origin_server": self.hs.hostname,
|
||||||
}
|
}
|
||||||
|
signed_body = sign_json(body, self.hs.hostname, self.hs.config.signing_key[0])
|
||||||
try:
|
try:
|
||||||
yield self.http_client.post_json_get_json(url, signed_batch)
|
yield self.http_client.post_json_get_json(url, signed_body)
|
||||||
self.store.update_replication_batch_for_host(host, batchnum)
|
self.store.update_replication_batch_for_host(host, batchnum)
|
||||||
logger.info("Sucessfully replicated profile batch %d to %s", batchnum, host)
|
logger.info("Sucessfully replicated profile batch %d to %s", batchnum, host)
|
||||||
except:
|
except:
|
||||||
|
|
Loading…
Reference in a new issue