mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-26 19:36:08 +03:00
Ensure we push only clean m.room.canonical_alias event
This commit is contained in:
parent
0a9b234272
commit
82b23d9a13
1 changed files with 7 additions and 1 deletions
|
@ -111,7 +111,13 @@ internal class DefaultStateService @AssistedInject constructor(@Assisted private
|
||||||
eventType = EventType.STATE_ROOM_CANONICAL_ALIAS,
|
eventType = EventType.STATE_ROOM_CANONICAL_ALIAS,
|
||||||
body = RoomCanonicalAliasContent(
|
body = RoomCanonicalAliasContent(
|
||||||
canonicalAlias = alias,
|
canonicalAlias = alias,
|
||||||
alternativeAliases = altAliases.distinct()
|
alternativeAliases = altAliases
|
||||||
|
// Ensure there is no duplicate
|
||||||
|
.distinct()
|
||||||
|
// Ensure the canonical alias is not also included in the alt alias
|
||||||
|
.minus(listOfNotNull(alias))
|
||||||
|
// Sort for the cleanup
|
||||||
|
.sorted()
|
||||||
).toContent(),
|
).toContent(),
|
||||||
callback = callback,
|
callback = callback,
|
||||||
stateKey = null
|
stateKey = null
|
||||||
|
|
Loading…
Reference in a new issue