Split long lines

This commit is contained in:
Benoit Marty 2020-09-30 12:46:28 +02:00
parent c5459cdde4
commit 5e2f65ab7a
1 changed files with 20 additions and 5 deletions

View File

@ -280,7 +280,12 @@ class NoticeEventFormatter @Inject constructor(private val activeSessionDataSour
prevContent != null -> { prevContent != null -> {
// Revoke case // Revoke case
if (event.isSentByCurrentUser()) { if (event.isSentByCurrentUser()) {
sp.getString(if (event.isDm()) R.string.notice_direct_room_third_party_revoked_invite_by_you else R.string.notice_room_third_party_revoked_invite_by_you, sp.getString(
if (event.isDm()) {
R.string.notice_direct_room_third_party_revoked_invite_by_you
} else {
R.string.notice_room_third_party_revoked_invite_by_you
},
prevContent.displayName) prevContent.displayName)
} else { } else {
sp.getString(if (event.isDm()) R.string.notice_direct_room_third_party_revoked_invite else R.string.notice_room_third_party_revoked_invite, sp.getString(if (event.isDm()) R.string.notice_direct_room_third_party_revoked_invite else R.string.notice_room_third_party_revoked_invite,
@ -411,14 +416,18 @@ class NoticeEventFormatter @Inject constructor(private val activeSessionDataSour
return when (eventContent?.guestAccess) { return when (eventContent?.guestAccess) {
GuestAccess.CanJoin -> GuestAccess.CanJoin ->
if (event.isSentByCurrentUser()) { if (event.isSentByCurrentUser()) {
sp.getString(if (event.isDm()) R.string.notice_direct_room_guest_access_can_join_by_you else R.string.notice_room_guest_access_can_join_by_you) sp.getString(
if (event.isDm()) R.string.notice_direct_room_guest_access_can_join_by_you else R.string.notice_room_guest_access_can_join_by_you
)
} else { } else {
sp.getString(if (event.isDm()) R.string.notice_direct_room_guest_access_can_join else R.string.notice_room_guest_access_can_join, sp.getString(if (event.isDm()) R.string.notice_direct_room_guest_access_can_join else R.string.notice_room_guest_access_can_join,
senderName) senderName)
} }
GuestAccess.Forbidden -> GuestAccess.Forbidden ->
if (event.isSentByCurrentUser()) { if (event.isSentByCurrentUser()) {
sp.getString(if (event.isDm()) R.string.notice_direct_room_guest_access_forbidden_by_you else R.string.notice_room_guest_access_forbidden_by_you) sp.getString(
if (event.isDm()) R.string.notice_direct_room_guest_access_forbidden_by_you else R.string.notice_room_guest_access_forbidden_by_you
)
} else { } else {
sp.getString(if (event.isDm()) R.string.notice_direct_room_guest_access_forbidden else R.string.notice_room_guest_access_forbidden, sp.getString(if (event.isDm()) R.string.notice_direct_room_guest_access_forbidden else R.string.notice_room_guest_access_forbidden,
senderName) senderName)
@ -578,8 +587,14 @@ class NoticeEventFormatter @Inject constructor(private val activeSessionDataSour
else -> else ->
eventContent.safeReason?.let { reason -> eventContent.safeReason?.let { reason ->
if (event.isSentByCurrentUser()) { if (event.isSentByCurrentUser()) {
sp.getString(if (event.isDm()) R.string.notice_direct_room_leave_with_reason_by_you else R.string.notice_room_leave_with_reason_by_you, sp.getString(
reason) if (event.isDm()) {
R.string.notice_direct_room_leave_with_reason_by_you
} else {
R.string.notice_room_leave_with_reason_by_you
},
reason
)
} else { } else {
sp.getString(if (event.isDm()) R.string.notice_direct_room_leave_with_reason else R.string.notice_room_leave_with_reason, sp.getString(if (event.isDm()) R.string.notice_direct_room_leave_with_reason else R.string.notice_room_leave_with_reason,
senderDisplayName, reason) senderDisplayName, reason)