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