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
b216b368
Commit
b216b368
authored
10 years ago
by
Kegan Dougal
Browse files
Options
Downloads
Patches
Plain Diff
JOIN state_events rather than parsing unrecognized_keys to pull out member state_keys
parent
3d73383d
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/storage/appservice.py
+1
-1
1 addition, 1 deletion
synapse/storage/appservice.py
synapse/storage/stream.py
+4
-10
4 additions, 10 deletions
synapse/storage/stream.py
with
5 additions
and
11 deletions
synapse/storage/appservice.py
+
1
−
1
View file @
b216b368
...
...
@@ -218,7 +218,7 @@ class ApplicationServiceStore(SQLBaseStore):
# less obvious.
# get all rooms matching the room ID regex.
room_entries
=
yield
self
.
get_all_rooms
()
# RoomEntry list
room_entries
=
yield
self
.
get_all_rooms
()
matching_room_list
=
set
([
r
[
"
room_id
"
]
for
r
in
room_entries
if
service
.
is_interested_in_room
(
r
[
"
room_id
"
])
...
...
This diff is collapsed.
Click to expand it.
synapse/storage/stream.py
+
4
−
10
View file @
b216b368
...
...
@@ -43,7 +43,6 @@ from synapse.util.logutils import log_function
from
collections
import
namedtuple
import
logging
import
simplejson
as
json
logger
=
logging
.
getLogger
(
__name__
)
...
...
@@ -161,8 +160,9 @@ class StreamStore(SQLBaseStore):
# select all the events between from/to with a sensible limit
sql
=
(
"
SELECT e.event_id, e.room_id, e.type, e.unrecognized_keys,
"
"
e.stream_ordering FROM events AS e
"
"
SELECT e.event_id, e.room_id, e.type, s.state_key,
"
"
e.stream_ordering FROM events AS e LEFT JOIN state_events as s ON
"
"
e.event_id = s.event_id
"
"
WHERE e.stream_ordering > ? AND e.stream_ordering <= ?
"
"
ORDER BY stream_ordering ASC LIMIT %(limit)d
"
)
%
{
...
...
@@ -174,13 +174,7 @@ class StreamStore(SQLBaseStore):
return
True
if
row
[
"
type
"
]
==
EventTypes
.
Member
:
# load up the content to inspect if some user the AS is
# interested in was invited to a room. We'll be passing this
# through _get_events_txn later, so ignore the fact that this
# may be a redacted event.
event_content
=
json
.
loads
(
row
[
"
unrecognized_keys
"
])
if
(
service
.
is_interested_in_user
(
event_content
.
get
(
"
state_key
"
))):
if
service
.
is_interested_in_user
(
row
.
get
(
"
state_key
"
)):
return
True
return
False
...
...
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