Emote: format notification
This commit is contained in:
parent
35b7b661f2
commit
2a7a66fb18
1 changed files with 4 additions and 3 deletions
|
|
@ -87,7 +87,7 @@ class NotifiableEventResolver @Inject constructor(
|
|||
noisy = isNoisy,
|
||||
timestamp = this.timestamp,
|
||||
senderName = senderDisplayName,
|
||||
body = descriptionFromMessageContent(content),
|
||||
body = descriptionFromMessageContent(content, senderDisplayName ?: content.senderId.value),
|
||||
imageUriString = this.contentUrl,
|
||||
roomName = roomDisplayName,
|
||||
roomIsDirect = isDirect,
|
||||
|
|
@ -133,7 +133,7 @@ class NotifiableEventResolver @Inject constructor(
|
|||
NotificationContent.MessageLike.KeyVerificationStart -> null.also {
|
||||
Timber.tag(loggerTag.value).d("Ignoring notification for verification ${content.javaClass.simpleName}")
|
||||
}
|
||||
is NotificationContent.MessageLike.Poll -> {
|
||||
is NotificationContent.MessageLike.Poll -> {
|
||||
buildNotifiableMessageEvent(
|
||||
sessionId = userId,
|
||||
senderId = content.senderId,
|
||||
|
|
@ -205,10 +205,11 @@ class NotifiableEventResolver @Inject constructor(
|
|||
|
||||
private fun descriptionFromMessageContent(
|
||||
content: NotificationContent.MessageLike.RoomMessage,
|
||||
senderDisplayName: String,
|
||||
): String {
|
||||
return when (val messageType = content.messageType) {
|
||||
is AudioMessageType -> messageType.body
|
||||
is EmoteMessageType -> messageType.body
|
||||
is EmoteMessageType -> "* $senderDisplayName ${messageType.body}"
|
||||
is FileMessageType -> messageType.body
|
||||
is ImageMessageType -> messageType.body
|
||||
is NoticeMessageType -> messageType.body
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue