diff options
author | David Baker <dave@matrix.org> | 2018-04-12 17:59:37 +0100 |
---|---|---|
committer | David Baker <dave@matrix.org> | 2018-04-12 17:59:37 +0100 |
commit | 1147ce7e18d44c6c4833516deef923c5085b0574 (patch) | |
tree | a67e5579e4af6a0919f2c249480d65ab3431df95 /synapse/handlers/profile.py | |
parent | Trigger profile replication on profile change (diff) | |
download | synapse-1147ce7e18d44c6c4833516deef923c5085b0574.tar.xz |
Include origin_server in the sig!
Also be consistent with underscores
Diffstat (limited to 'synapse/handlers/profile.py')
-rw-r--r-- | synapse/handlers/profile.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/synapse/handlers/profile.py b/synapse/handlers/profile.py index 5ba6c257c7..454f828d41 100644 --- a/synapse/handlers/profile.py +++ b/synapse/handlers/profile.py @@ -89,19 +89,20 @@ class ProfileHandler(BaseHandler): batch_rows = yield self.store.get_profile_batch(batchnum) batch = { UserID(r["user_id"], self.hs.hostname).to_string(): { - "displayname": r["displayname"], + "display_name": r["displayname"], "avatar_url": r["avatar_url"], } for r in batch_rows } url = "https://%s/_matrix/federation/v1/replicate_profiles" % (host,) - signed_batch = { + body = { "batchnum": batchnum, - "signed_batch": sign_json(batch, self.hs.hostname, self.hs.config.signing_key[0]), + "batch": batch, "origin_server": self.hs.hostname, } + signed_body = sign_json(body, self.hs.hostname, self.hs.config.signing_key[0]) 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) logger.info("Sucessfully replicated profile batch %d to %s", batchnum, host) except: |