This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Implement rechecking of redactions for room versions v3 #4499
Merged
Merged
Changes from 13 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
7a3ec5b
Add RoomVersions.V3 constant, without enabling it
erikjohnston 7709d2b
Implement rechecking of redactions
erikjohnston 7d1024d
Newsfile
erikjohnston b82a76c
Finish comment...
erikjohnston 82165ee
Update synapse/storage/events_worker.py
richvdh 38590a4
Add docstring
erikjohnston 47e2dd1
Drop vdh support
erikjohnston b5d510a
Remove unused arg
erikjohnston 6d23ec2
Fix typo
erikjohnston 4db252c
Check redaction state when event is pulled out of the database
erikjohnston c21b7cb
Update synapse/storage/events_worker.py
erikjohnston a696c48
Merge branch 'develop' of github.com:matrix-org/synapse into erikj/re…
erikjohnston f46a818
kill vdh test some more
erikjohnston afeea31
Fixup comment
erikjohnston 67b82f1
Merge branch 'develop' of github.com:matrix-org/synapse into erikj/re…
erikjohnston File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add support for room version 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,6 +62,21 @@ def get_send_on_behalf_of(self): | |
""" | ||
return getattr(self, "send_on_behalf_of", None) | ||
|
||
def need_to_check_redaction(self): | ||
"""Whether the redaction event needs to be rechecked when fetching | ||
from the database. | ||
|
||
Starting in room v3 redaction events are accepted up front, and later | ||
checked to see if the redacter and redactee's domains match. | ||
|
||
If the sender of the redaction event is allowed to redact due to auth | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "is allowed to redact any event" |
||
rules, then this will always return false. | ||
|
||
Returns: | ||
bool | ||
""" | ||
return getattr(self, "recheck_redaction", False) | ||
|
||
|
||
def _event_dict_property(key): | ||
# We want to be able to use hasattr with the event dict properties. | ||
|
@@ -328,8 +343,7 @@ def room_version_to_event_format(room_version): | |
raise RuntimeError("Unrecognized room version %s" % (room_version,)) | ||
|
||
if room_version in ( | ||
RoomVersions.V1, RoomVersions.V2, RoomVersions.VDH_TEST, | ||
RoomVersions.STATE_V2_TEST, | ||
RoomVersions.V1, RoomVersions.V2, RoomVersions.STATE_V2_TEST, | ||
): | ||
return EventFormatVersions.V1 | ||
else: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can has docstring please - what does this mean?