1
0

add a comment explaining part of the query

This commit is contained in:
Hubert Chathi
2018-11-21 14:56:40 -05:00
parent 0d0ee82a6b
commit 5be7ec5dc9

View File

@@ -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)