mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-04 05:24:55 -04:00
Remove special auth and redaction rules for aliases events in experimental room ver. (#7037)
This commit is contained in:
parent
66315d862f
commit
06eb5cae08
8 changed files with 148 additions and 22 deletions
|
@ -13,6 +13,7 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from synapse.api.room_versions import RoomVersions
|
||||
from synapse.events import make_event_from_dict
|
||||
from synapse.events.utils import (
|
||||
copy_power_levels_contents,
|
||||
|
@ -36,9 +37,9 @@ class PruneEventTestCase(unittest.TestCase):
|
|||
""" Asserts that a new event constructed with `evdict` will look like
|
||||
`matchdict` when it is redacted. """
|
||||
|
||||
def run_test(self, evdict, matchdict):
|
||||
def run_test(self, evdict, matchdict, **kwargs):
|
||||
self.assertEquals(
|
||||
prune_event(make_event_from_dict(evdict)).get_dict(), matchdict
|
||||
prune_event(make_event_from_dict(evdict, **kwargs)).get_dict(), matchdict
|
||||
)
|
||||
|
||||
def test_minimal(self):
|
||||
|
@ -128,6 +129,36 @@ class PruneEventTestCase(unittest.TestCase):
|
|||
},
|
||||
)
|
||||
|
||||
def test_alias_event(self):
|
||||
"""Alias events have special behavior up through room version 6."""
|
||||
self.run_test(
|
||||
{
|
||||
"type": "m.room.aliases",
|
||||
"event_id": "$test:domain",
|
||||
"content": {"aliases": ["test"]},
|
||||
},
|
||||
{
|
||||
"type": "m.room.aliases",
|
||||
"event_id": "$test:domain",
|
||||
"content": {"aliases": ["test"]},
|
||||
"signatures": {},
|
||||
"unsigned": {},
|
||||
},
|
||||
)
|
||||
|
||||
def test_msc2432_alias_event(self):
|
||||
"""After MSC2432, alias events have no special behavior."""
|
||||
self.run_test(
|
||||
{"type": "m.room.aliases", "content": {"aliases": ["test"]}},
|
||||
{
|
||||
"type": "m.room.aliases",
|
||||
"content": {},
|
||||
"signatures": {},
|
||||
"unsigned": {},
|
||||
},
|
||||
room_version=RoomVersions.MSC2432_DEV,
|
||||
)
|
||||
|
||||
|
||||
class SerializeEventTestCase(unittest.TestCase):
|
||||
def serialize(self, ev, fields):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue