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