mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
Hide verbose state events from the timeline (#2225)
This commit is contained in:
committed by
GitHub
parent
0b859209e2
commit
4a7b04524a
+5
-1
@@ -85,7 +85,11 @@ data class ProfileChangeContent(
|
||||
data class StateContent(
|
||||
val stateKey: String,
|
||||
val content: OtherState
|
||||
) : EventContent
|
||||
) : EventContent {
|
||||
fun isVisibleInTimeline(): Boolean {
|
||||
return content.isVisibleInTimeline()
|
||||
}
|
||||
}
|
||||
|
||||
data class FailedToParseMessageLikeContent(
|
||||
val eventType: String,
|
||||
|
||||
+26
@@ -41,4 +41,30 @@ sealed interface OtherState {
|
||||
data object SpaceChild : OtherState
|
||||
data object SpaceParent : OtherState
|
||||
data class Custom(val eventType: String) : OtherState
|
||||
|
||||
fun isVisibleInTimeline() = when (this) {
|
||||
// Visible
|
||||
is RoomAvatar,
|
||||
is RoomName,
|
||||
is RoomTopic,
|
||||
is RoomThirdPartyInvite,
|
||||
is RoomCreate,
|
||||
is RoomEncryption,
|
||||
is Custom -> true
|
||||
// Hidden
|
||||
is RoomAliases,
|
||||
is RoomCanonicalAlias,
|
||||
is RoomGuestAccess,
|
||||
is RoomHistoryVisibility,
|
||||
is RoomJoinRules,
|
||||
is RoomPinnedEvents,
|
||||
is RoomPowerLevels,
|
||||
is RoomServerAcl,
|
||||
is RoomTombstone,
|
||||
is SpaceChild,
|
||||
is SpaceParent,
|
||||
is PolicyRuleRoom,
|
||||
is PolicyRuleServer,
|
||||
is PolicyRuleUser -> false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user