Small rework code to avoid dead code.
This commit is contained in:
parent
fc7898ca36
commit
9420597622
1 changed files with 7 additions and 13 deletions
|
|
@ -113,7 +113,7 @@ class NotifiableEventResolver @Inject constructor(
|
||||||
soundName = null,
|
soundName = null,
|
||||||
isRedacted = false,
|
isRedacted = false,
|
||||||
isUpdated = false,
|
isUpdated = false,
|
||||||
description = descriptionFromRoomMembershipContent(content, isDirect) ?: return null,
|
description = descriptionFromRoomMembershipInvite(isDirect),
|
||||||
type = null, // TODO check if type is needed anymore
|
type = null, // TODO check if type is needed anymore
|
||||||
title = null, // TODO check if title is needed anymore
|
title = null, // TODO check if title is needed anymore
|
||||||
)
|
)
|
||||||
|
|
@ -226,19 +226,13 @@ class NotifiableEventResolver @Inject constructor(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun descriptionFromRoomMembershipContent(
|
private fun descriptionFromRoomMembershipInvite(
|
||||||
content: NotificationContent.StateEvent.RoomMemberContent,
|
|
||||||
isDirectRoom: Boolean
|
isDirectRoom: Boolean
|
||||||
): String? {
|
): String {
|
||||||
return when (content.membershipState) {
|
return if (isDirectRoom) {
|
||||||
RoomMembershipState.INVITE -> {
|
stringProvider.getString(R.string.notification_invite_body)
|
||||||
if (isDirectRoom) {
|
} else {
|
||||||
stringProvider.getString(R.string.notification_invite_body)
|
stringProvider.getString(R.string.notification_room_invite_body)
|
||||||
} else {
|
|
||||||
stringProvider.getString(R.string.notification_room_invite_body)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else -> null
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue