From 5be7ec5dc9e557703bbd7e655f077038827b8e1d Mon Sep 17 00:00:00 2001 From: Hubert Chathi Date: Wed, 21 Nov 2018 14:56:40 -0500 Subject: [PATCH] add a comment explaining part of the query --- synapse/storage/end_to_end_keys.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/synapse/storage/end_to_end_keys.py b/synapse/storage/end_to_end_keys.py index f08a4efbfc..39842632de 100644 --- a/synapse/storage/end_to_end_keys.py +++ b/synapse/storage/end_to_end_keys.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # Copyright 2015, 2016 OpenMarket Ltd +# Copyright 2018 New Vector Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -322,6 +323,11 @@ class EndToEndKeyStore(SQLBaseStore): query_params = [] for (user_id, device_id) in query_list: + # Users can only see attestations made by themselves about the + # target user's devices, or by the target user about their own + # devices. If the requesting user is not specified, select only + # the publicly visible attestations, that is, attestations made by + # the target user's own devices. if from_user_id: query_clause = "(from_user_id = ? OR from_user_id = ?)" query_params.append(from_user_id)