File tree Expand file tree Collapse file tree 3 files changed +16
-10
lines changed
vector-config/src/main/java/im/vector/app/config
vector/src/main/java/im/vector/app/features/room Expand file tree Collapse file tree 3 files changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -42,8 +42,10 @@ object Config {
42
42
const val ENABLE_LOCATION_SHARING = true
43
43
const val LOCATION_MAP_TILER_KEY = " fU3vlMsMn4Jb6dnEIFsx"
44
44
45
- // / Whether to read the `io.element.functional_members` state event
46
- // and exclude any service members when computing a room's name and avatar.
45
+ /* *
46
+ * Whether to read the `io.element.functional_members` state event
47
+ * and exclude any service members when computing a room's name and avatar.
48
+ */
47
49
const val SUPPORT_FUNCTIONAL_MEMBERS = true
48
50
49
51
/* *
Original file line number Diff line number Diff line change @@ -26,11 +26,13 @@ private const val FUNCTIONAL_MEMBERS_STATE_EVENT_TYPE = "io.element.functional_m
26
26
27
27
@JsonClass(generateAdapter = true )
28
28
data class FunctionalMembersContent (
29
- @Json(name = " service_members" ) val userIds : List <String >
29
+ @Json(name = " service_members" ) val userIds : List <String >? = null
30
30
)
31
31
32
32
fun StateService.getFunctionalMembers (): List <String > {
33
- return getStateEvent(FUNCTIONAL_MEMBERS_STATE_EVENT_TYPE , QueryStringValue .IsEmpty )?.let {
34
- it.content.toModel<FunctionalMembersContent >()?.userIds
35
- }.orEmpty()
33
+ return getStateEvent(FUNCTIONAL_MEMBERS_STATE_EVENT_TYPE , QueryStringValue .IsEmpty )
34
+ ?.content
35
+ ?.toModel<FunctionalMembersContent >()
36
+ ?.userIds
37
+ .orEmpty()
36
38
}
Original file line number Diff line number Diff line change @@ -32,10 +32,12 @@ class VectorRoomDisplayNameFallbackProvider @Inject constructor(
32
32
33
33
override fun excludedUserIds (roomId : String ): List <String > {
34
34
if (! Config .SUPPORT_FUNCTIONAL_MEMBERS ) return emptyList()
35
- return activeSessionHolder.get().getSafeActiveSession()
36
- ?.getRoom(roomId)?.let { room ->
37
- room.stateService().getFunctionalMembers()
38
- }.orEmpty()
35
+ return activeSessionHolder.get()
36
+ .getSafeActiveSession()
37
+ ?.getRoom(roomId)
38
+ ?.stateService()
39
+ ?.getFunctionalMembers()
40
+ .orEmpty()
39
41
}
40
42
41
43
override fun getNameForRoomInvite (): String {
You can’t perform that action at this time.
0 commit comments