mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 12:26:02 -04:00
Start implementing auth chains
This commit is contained in:
parent
8421cabb9d
commit
bf6b72eb55
8 changed files with 115 additions and 6 deletions
|
@ -139,6 +139,27 @@ class EventFederationStore(SQLBaseStore):
|
|||
|
||||
return results
|
||||
|
||||
def _get_auth_events(self, txn, event_id):
|
||||
auth_ids = self._simple_select_onecol_txn(
|
||||
txn,
|
||||
table="event_auth",
|
||||
keyvalues={
|
||||
"event_id": event_id,
|
||||
},
|
||||
retcol="auth_id",
|
||||
)
|
||||
|
||||
results = []
|
||||
for auth_id in auth_ids:
|
||||
hashes = self._get_event_reference_hashes_txn(txn, auth_id)
|
||||
prev_hashes = {
|
||||
k: encode_base64(v) for k, v in hashes.items()
|
||||
if k == "sha256"
|
||||
}
|
||||
results.append((auth_id, prev_hashes))
|
||||
|
||||
return results
|
||||
|
||||
def get_min_depth(self, room_id):
|
||||
return self.runInteraction(
|
||||
"get_min_depth",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue