mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-06 05:53:33 +01:00
Start fixing notif for invites
This commit is contained in:
parent
981c9ac4ac
commit
9cdb1da614
@ -51,20 +51,20 @@ class NotifiableEventResolver @Inject constructor(private val stringProvider: St
|
||||
fun resolveEvent(event: Event/*, roomState: RoomState?, bingRule: PushRule?*/, session: Session): NotifiableEvent? {
|
||||
val roomID = event.roomId ?: return null
|
||||
val eventId = event.eventId ?: return null
|
||||
if (event.getClearType() == EventType.STATE_ROOM_MEMBER) {
|
||||
return resolveStateRoomEvent(event, session)
|
||||
}
|
||||
val timelineEvent = session.getRoom(roomID)?.getTimeLineEvent(eventId) ?: return null
|
||||
when (event.getClearType()) {
|
||||
EventType.MESSAGE -> {
|
||||
EventType.MESSAGE -> {
|
||||
return resolveMessageEvent(timelineEvent, session)
|
||||
}
|
||||
EventType.ENCRYPTED -> {
|
||||
EventType.ENCRYPTED -> {
|
||||
val messageEvent = resolveMessageEvent(timelineEvent, session)
|
||||
messageEvent?.lockScreenVisibility = NotificationCompat.VISIBILITY_PRIVATE
|
||||
return messageEvent
|
||||
}
|
||||
EventType.STATE_ROOM_MEMBER -> {
|
||||
return resolveStateRoomEvent(event, session)
|
||||
}
|
||||
else -> {
|
||||
else -> {
|
||||
// If the event can be displayed, display it as is
|
||||
Timber.w("NotifiableEventResolver Received an unsupported event matching a bing rule")
|
||||
// TODO Better event text display
|
||||
|
@ -130,9 +130,9 @@ class NotificationDrawerManager @Inject constructor(private val context: Context
|
||||
|
||||
fun onEventRedacted(eventId: String) {
|
||||
synchronized(eventList) {
|
||||
eventList.filter { it.eventId == eventId }.map { notifiableEvent ->
|
||||
notifiableEvent.isRedacted = true
|
||||
notifiableEvent.hasBeenDisplayed = false
|
||||
eventList.find { it.eventId == eventId }?.apply {
|
||||
isRedacted = true
|
||||
hasBeenDisplayed = false
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -182,7 +182,6 @@ class NotificationDrawerManager @Inject constructor(private val context: Context
|
||||
e is InviteNotifiableEvent && e.roomId == roomId
|
||||
}
|
||||
}
|
||||
|
||||
notificationUtils.cancelNotificationMessage(roomId, ROOM_INVITATION_NOTIFICATION_ID)
|
||||
}
|
||||
|
||||
|
@ -515,7 +515,7 @@ class NotificationUtils @Inject constructor(private val context: Context,
|
||||
val joinIntent = Intent(context, NotificationBroadcastReceiver::class.java)
|
||||
joinIntent.action = JOIN_ACTION
|
||||
joinIntent.data = Uri.parse("foobar://$roomId&$matrixId")
|
||||
rejectIntent.putExtra(NotificationBroadcastReceiver.KEY_ROOM_ID, roomId)
|
||||
joinIntent.putExtra(NotificationBroadcastReceiver.KEY_ROOM_ID, roomId)
|
||||
val joinIntentPendingIntent = PendingIntent.getBroadcast(context, System.currentTimeMillis().toInt(), joinIntent,
|
||||
PendingIntent.FLAG_UPDATE_CURRENT)
|
||||
addAction(
|
||||
|
Loading…
x
Reference in New Issue
Block a user