Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Matrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Operate
Environments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Matrix
Commits
2215faa3
Commit
2215faa3
authored
10 years ago
by
Erik Johnston
Browse files
Options
Downloads
Plain Diff
Merge branch 'hotfixes-v0.5.4a' of github.com:matrix-org/synapse into release-v0.6.0
parents
2d7716d4
3defd5b3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
synapse/handlers/federation.py
+6
-2
6 additions, 2 deletions
synapse/handlers/federation.py
synapse/storage/event_federation.py
+8
-8
8 additions, 8 deletions
synapse/storage/event_federation.py
with
14 additions
and
10 deletions
synapse/handlers/federation.py
+
6
−
2
View file @
2215faa3
...
...
@@ -173,6 +173,7 @@ class FederationHandler(BaseHandler):
context
=
event
.
room_id
,
event_id
=
event
.
event_id
,
)
# FIXME: Get auth chain for these state events
current_state
=
state
...
...
@@ -288,7 +289,7 @@ class FederationHandler(BaseHandler):
@defer.inlineCallbacks
def
on_event_auth
(
self
,
event_id
):
auth
=
yield
self
.
store
.
get_auth_chain
(
event_id
)
auth
=
yield
self
.
store
.
get_auth_chain
(
[
event_id
]
)
for
event
in
auth
:
event
.
signatures
.
update
(
...
...
@@ -528,7 +529,10 @@ class FederationHandler(BaseHandler):
yield
self
.
replication_layer
.
send_pdu
(
new_pdu
,
destinations
)
auth_chain
=
yield
self
.
store
.
get_auth_chain
(
event
.
event_id
)
state_ids
=
[
e
.
event_id
for
e
in
event
.
state_events
.
values
()]
auth_chain
=
yield
self
.
store
.
get_auth_chain
(
set
(
[
event
.
event_id
]
+
state_ids
))
defer
.
returnValue
({
"
state
"
:
context
.
current_state
.
values
(),
...
...
This diff is collapsed.
Click to expand it.
synapse/storage/event_federation.py
+
8
−
8
View file @
2215faa3
...
...
@@ -32,15 +32,15 @@ class EventFederationStore(SQLBaseStore):
and backfilling from another server respectively.
"""
def
get_auth_chain
(
self
,
event_id
):
def
get_auth_chain
(
self
,
event_id
s
):
return
self
.
runInteraction
(
"
get_auth_chain
"
,
self
.
_get_auth_chain_txn
,
event_id
event_id
s
)
def
_get_auth_chain_txn
(
self
,
txn
,
event_id
):
results
=
self
.
_get_auth_chain_ids_txn
(
txn
,
event_id
)
def
_get_auth_chain_txn
(
self
,
txn
,
event_id
s
):
results
=
self
.
_get_auth_chain_ids_txn
(
txn
,
event_id
s
)
sql
=
"
SELECT * FROM events WHERE event_id = ?
"
rows
=
[]
...
...
@@ -50,21 +50,21 @@ class EventFederationStore(SQLBaseStore):
return
self
.
_parse_events_txn
(
txn
,
rows
)
def
get_auth_chain_ids
(
self
,
event_id
):
def
get_auth_chain_ids
(
self
,
event_id
s
):
return
self
.
runInteraction
(
"
get_auth_chain_ids
"
,
self
.
_get_auth_chain_ids_txn
,
event_id
event_id
s
)
def
_get_auth_chain_ids_txn
(
self
,
txn
,
event_id
):
def
_get_auth_chain_ids_txn
(
self
,
txn
,
event_id
s
):
results
=
set
()
base_sql
=
(
"
SELECT auth_id FROM event_auth WHERE %s
"
)
front
=
set
(
[
event_id
]
)
front
=
set
(
event_id
s
)
while
front
:
sql
=
base_sql
%
(
"
OR
"
.
join
([
"
event_id=?
"
]
*
len
(
front
)),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment