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
22284a6f
Unverified
Commit
22284a6f
authored
6 years ago
by
Richard van der Hoff
Committed by
GitHub
6 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #3060 from matrix-org/rav/kill_event_content
Remove uses of events.content
parents
7d0f7123
2fe3f848
No related branches found
Branches containing commit
Tags
v0.18.2-rc1
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
synapse/storage/room.py
+4
-3
4 additions, 3 deletions
synapse/storage/room.py
synapse/storage/roommember.py
+4
-2
4 additions, 2 deletions
synapse/storage/roommember.py
synapse/storage/search.py
+4
-2
4 additions, 2 deletions
synapse/storage/search.py
with
12 additions
and
7 deletions
synapse/storage/room.py
+
4
−
3
View file @
22284a6f
...
...
@@ -594,7 +594,8 @@ class RoomStore(RoomWorkerStore, SearchStore):
while
next_token
:
sql
=
"""
SELECT stream_ordering, content FROM events
SELECT stream_ordering, json FROM events
JOIN event_json USING (event_id)
WHERE room_id = ?
AND stream_ordering < ?
AND contains_url = ? AND outlier = ?
...
...
@@ -606,8 +607,8 @@ class RoomStore(RoomWorkerStore, SearchStore):
next_token
=
None
for
stream_ordering
,
content_json
in
txn
:
next_token
=
stream_ordering
content
=
json
.
loads
(
content_json
)
event_json
=
json
.
loads
(
content_json
)
content
=
event_json
[
"
content
"
]
content_url
=
content
.
get
(
"
url
"
)
thumbnail_url
=
content
.
get
(
"
info
"
,
{}).
get
(
"
thumbnail_url
"
)
...
...
This diff is collapsed.
Click to expand it.
synapse/storage/roommember.py
+
4
−
2
View file @
22284a6f
...
...
@@ -645,8 +645,9 @@ class RoomMemberStore(RoomMemberWorkerStore):
def
add_membership_profile_txn
(
txn
):
sql
=
(
"""
SELECT stream_ordering, event_id, events.room_id,
content
SELECT stream_ordering, event_id, events.room_id,
event_json.json
FROM events
INNER JOIN event_json USING (event_id)
INNER JOIN room_memberships USING (event_id)
WHERE ? <= stream_ordering AND stream_ordering < ?
AND type =
'
m.room.member
'
...
...
@@ -667,7 +668,8 @@ class RoomMemberStore(RoomMemberWorkerStore):
event_id
=
row
[
"
event_id
"
]
room_id
=
row
[
"
room_id
"
]
try
:
content
=
json
.
loads
(
row
[
"
content
"
])
event_json
=
json
.
loads
(
row
[
"
json
"
])
content
=
event_json
[
'
content
'
]
except
Exception
:
continue
...
...
This diff is collapsed.
Click to expand it.
synapse/storage/search.py
+
4
−
2
View file @
22284a6f
...
...
@@ -75,8 +75,9 @@ class SearchStore(BackgroundUpdateStore):
def
reindex_search_txn
(
txn
):
sql
=
(
"
SELECT stream_ordering, event_id, room_id, type,
content
,
"
"
SELECT stream_ordering, event_id, room_id, type,
json
,
"
"
origin_server_ts FROM events
"
"
JOIN event_json USING (event_id)
"
"
WHERE ? <= stream_ordering AND stream_ordering < ?
"
"
AND (%s)
"
"
ORDER BY stream_ordering DESC
"
...
...
@@ -104,7 +105,8 @@ class SearchStore(BackgroundUpdateStore):
stream_ordering
=
row
[
"
stream_ordering
"
]
origin_server_ts
=
row
[
"
origin_server_ts
"
]
try
:
content
=
json
.
loads
(
row
[
"
content
"
])
event_json
=
json
.
loads
(
row
[
"
json
"
])
content
=
event_json
[
"
content
"
]
except
Exception
:
continue
...
...
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