mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-17 04:20:00 +03:00
Support showing push notifications for poll start events.
This commit is contained in:
parent
bdc9bc0d4d
commit
9fa285e6ca
1 changed files with 4 additions and 3 deletions
|
@ -94,7 +94,7 @@ class NotifiableEventResolver @Inject constructor(
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun resolveInMemoryEvent(session: Session, event: Event, canBeReplaced: Boolean): NotifiableEvent? {
|
suspend fun resolveInMemoryEvent(session: Session, event: Event, canBeReplaced: Boolean): NotifiableEvent? {
|
||||||
if (event.getClearType() != EventType.MESSAGE) return null
|
if (event.getClearType() !in listOf(EventType.MESSAGE, EventType.POLL_START)) return null
|
||||||
|
|
||||||
// Ignore message edition
|
// Ignore message edition
|
||||||
if (event.isEdition()) return null
|
if (event.isEdition()) return null
|
||||||
|
@ -153,7 +153,8 @@ class NotifiableEventResolver @Inject constructor(
|
||||||
event.attemptToDecryptIfNeeded(session)
|
event.attemptToDecryptIfNeeded(session)
|
||||||
// only convert encrypted messages to NotifiableMessageEvents
|
// only convert encrypted messages to NotifiableMessageEvents
|
||||||
when (event.root.getClearType()) {
|
when (event.root.getClearType()) {
|
||||||
EventType.MESSAGE -> {
|
EventType.MESSAGE,
|
||||||
|
EventType.POLL_START -> {
|
||||||
val body = displayableEventFormatter.format(event, isDm = room.roomSummary()?.isDirect.orFalse(), appendAuthor = false).toString()
|
val body = displayableEventFormatter.format(event, isDm = room.roomSummary()?.isDirect.orFalse(), appendAuthor = false).toString()
|
||||||
val roomName = room.roomSummary()?.displayName ?: ""
|
val roomName = room.roomSummary()?.displayName ?: ""
|
||||||
val senderDisplayName = event.senderInfo.disambiguatedDisplayName
|
val senderDisplayName = event.senderInfo.disambiguatedDisplayName
|
||||||
|
@ -185,7 +186,7 @@ class NotifiableEventResolver @Inject constructor(
|
||||||
soundName = null
|
soundName = null
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
else -> null
|
else -> null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue