mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 10:25:35 +03:00
updating variable casing as they're no longer const val or file level
This commit is contained in:
parent
8b9d1bb0d8
commit
9b1def3c1d
6 changed files with 28 additions and 28 deletions
|
@ -102,7 +102,7 @@ class VectorMessagingReceiver : MessagingReceiver() {
|
|||
|
||||
// Diagnostic Push
|
||||
if (pushData.eventId == PushersManager.TEST_EVENT_ID) {
|
||||
val intent = Intent(actionIds.PUSH_ACTION)
|
||||
val intent = Intent(actionIds.push)
|
||||
LocalBroadcastManager.getInstance(context).sendBroadcast(intent)
|
||||
return
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ class LiveLocationNotificationBuilder @Inject constructor(
|
|||
liveLocationMapViewArgs = LiveLocationMapViewArgs(roomId = roomId),
|
||||
firstStartMainActivity = true
|
||||
)
|
||||
mapIntent.action = actionIds.TAP_TO_VIEW_ACTION
|
||||
mapIntent.action = actionIds.tapToView
|
||||
// pending intent get reused by system, this will mess up the extra params, so put unique info to avoid that
|
||||
mapIntent.data = createIgnoredUri("openLiveLocationMap?$roomId")
|
||||
|
||||
|
|
|
@ -28,14 +28,14 @@ data class NotificationActionIds @Inject constructor(
|
|||
private val buildMeta: BuildMeta,
|
||||
) {
|
||||
|
||||
val JOIN_ACTION = "${buildMeta.applicationId}.NotificationActions.JOIN_ACTION"
|
||||
val REJECT_ACTION = "${buildMeta.applicationId}.NotificationActions.REJECT_ACTION"
|
||||
val QUICK_LAUNCH_ACTION = "${buildMeta.applicationId}.NotificationActions.QUICK_LAUNCH_ACTION"
|
||||
val MARK_ROOM_READ_ACTION = "${buildMeta.applicationId}.NotificationActions.MARK_ROOM_READ_ACTION"
|
||||
val SMART_REPLY_ACTION = "${buildMeta.applicationId}.NotificationActions.SMART_REPLY_ACTION"
|
||||
val DISMISS_SUMMARY_ACTION = "${buildMeta.applicationId}.NotificationActions.DISMISS_SUMMARY_ACTION"
|
||||
val DISMISS_ROOM_NOTIF_ACTION = "${buildMeta.applicationId}.NotificationActions.DISMISS_ROOM_NOTIF_ACTION"
|
||||
val TAP_TO_VIEW_ACTION = "${buildMeta.applicationId}.NotificationActions.TAP_TO_VIEW_ACTION"
|
||||
val DIAGNOSTIC_ACTION = "${buildMeta.applicationId}.NotificationActions.DIAGNOSTIC"
|
||||
val PUSH_ACTION = "${buildMeta.applicationId}.PUSH"
|
||||
val join = "${buildMeta.applicationId}.NotificationActions.JOIN_ACTION"
|
||||
val reject = "${buildMeta.applicationId}.NotificationActions.REJECT_ACTION"
|
||||
val quickLaunch = "${buildMeta.applicationId}.NotificationActions.QUICK_LAUNCH_ACTION"
|
||||
val markRoomRead = "${buildMeta.applicationId}.NotificationActions.MARK_ROOM_READ_ACTION"
|
||||
val smartReply = "${buildMeta.applicationId}.NotificationActions.SMART_REPLY_ACTION"
|
||||
val dismissSummary = "${buildMeta.applicationId}.NotificationActions.DISMISS_SUMMARY_ACTION"
|
||||
val dismissRoom = "${buildMeta.applicationId}.NotificationActions.DISMISS_ROOM_NOTIF_ACTION"
|
||||
val tapToView = "${buildMeta.applicationId}.NotificationActions.TAP_TO_VIEW_ACTION"
|
||||
val diagnostic = "${buildMeta.applicationId}.NotificationActions.DIAGNOSTIC"
|
||||
val push = "${buildMeta.applicationId}.PUSH"
|
||||
}
|
||||
|
|
|
@ -54,26 +54,26 @@ class NotificationBroadcastReceiver : BroadcastReceiver() {
|
|||
if (intent == null || context == null) return
|
||||
Timber.v("NotificationBroadcastReceiver received : $intent")
|
||||
when (intent.action) {
|
||||
actionIds.SMART_REPLY_ACTION ->
|
||||
actionIds.smartReply ->
|
||||
handleSmartReply(intent, context)
|
||||
actionIds.DISMISS_ROOM_NOTIF_ACTION ->
|
||||
actionIds.dismissRoom ->
|
||||
intent.getStringExtra(KEY_ROOM_ID)?.let { roomId ->
|
||||
notificationDrawerManager.updateEvents { it.clearMessagesForRoom(roomId) }
|
||||
}
|
||||
actionIds.DISMISS_SUMMARY_ACTION ->
|
||||
actionIds.dismissSummary ->
|
||||
notificationDrawerManager.clearAllEvents()
|
||||
actionIds.MARK_ROOM_READ_ACTION ->
|
||||
actionIds.markRoomRead ->
|
||||
intent.getStringExtra(KEY_ROOM_ID)?.let { roomId ->
|
||||
notificationDrawerManager.updateEvents { it.clearMessagesForRoom(roomId) }
|
||||
handleMarkAsRead(roomId)
|
||||
}
|
||||
actionIds.JOIN_ACTION -> {
|
||||
actionIds.join -> {
|
||||
intent.getStringExtra(KEY_ROOM_ID)?.let { roomId ->
|
||||
notificationDrawerManager.updateEvents { it.clearMemberShipNotificationForRoom(roomId) }
|
||||
handleJoinRoom(roomId)
|
||||
}
|
||||
}
|
||||
actionIds.REJECT_ACTION -> {
|
||||
actionIds.reject -> {
|
||||
intent.getStringExtra(KEY_ROOM_ID)?.let { roomId ->
|
||||
notificationDrawerManager.updateEvents { it.clearMemberShipNotificationForRoom(roomId) }
|
||||
handleRejectRoom(roomId)
|
||||
|
|
|
@ -632,7 +632,7 @@ class NotificationUtils @Inject constructor(
|
|||
// Add actions and notification intents
|
||||
// Mark room as read
|
||||
val markRoomReadIntent = Intent(context, NotificationBroadcastReceiver::class.java)
|
||||
markRoomReadIntent.action = actionIds.MARK_ROOM_READ_ACTION
|
||||
markRoomReadIntent.action = actionIds.markRoomRead
|
||||
markRoomReadIntent.data = createIgnoredUri(roomInfo.roomId)
|
||||
markRoomReadIntent.putExtra(NotificationBroadcastReceiver.KEY_ROOM_ID, roomInfo.roomId)
|
||||
val markRoomReadPendingIntent = PendingIntent.getBroadcast(
|
||||
|
@ -679,7 +679,7 @@ class NotificationUtils @Inject constructor(
|
|||
|
||||
val intent = Intent(context, NotificationBroadcastReceiver::class.java)
|
||||
intent.putExtra(NotificationBroadcastReceiver.KEY_ROOM_ID, roomInfo.roomId)
|
||||
intent.action = actionIds.DISMISS_ROOM_NOTIF_ACTION
|
||||
intent.action = actionIds.dismissRoom
|
||||
val pendingIntent = PendingIntent.getBroadcast(
|
||||
context.applicationContext,
|
||||
clock.epochMillis().toInt(),
|
||||
|
@ -714,7 +714,7 @@ class NotificationUtils @Inject constructor(
|
|||
val roomId = inviteNotifiableEvent.roomId
|
||||
// offer to type a quick reject button
|
||||
val rejectIntent = Intent(context, NotificationBroadcastReceiver::class.java)
|
||||
rejectIntent.action = actionIds.REJECT_ACTION
|
||||
rejectIntent.action = actionIds.reject
|
||||
rejectIntent.data = createIgnoredUri("$roomId&$matrixId")
|
||||
rejectIntent.putExtra(NotificationBroadcastReceiver.KEY_ROOM_ID, roomId)
|
||||
val rejectIntentPendingIntent = PendingIntent.getBroadcast(
|
||||
|
@ -732,7 +732,7 @@ class NotificationUtils @Inject constructor(
|
|||
|
||||
// offer to type a quick accept button
|
||||
val joinIntent = Intent(context, NotificationBroadcastReceiver::class.java)
|
||||
joinIntent.action = actionIds.JOIN_ACTION
|
||||
joinIntent.action = actionIds.join
|
||||
joinIntent.data = createIgnoredUri("$roomId&$matrixId")
|
||||
joinIntent.putExtra(NotificationBroadcastReceiver.KEY_ROOM_ID, roomId)
|
||||
val joinIntentPendingIntent = PendingIntent.getBroadcast(
|
||||
|
@ -815,7 +815,7 @@ class NotificationUtils @Inject constructor(
|
|||
|
||||
private fun buildOpenRoomIntent(roomId: String): PendingIntent? {
|
||||
val roomIntentTap = RoomDetailActivity.newIntent(context, TimelineArgs(roomId = roomId, switchToParentSpace = true), true)
|
||||
roomIntentTap.action = actionIds.TAP_TO_VIEW_ACTION
|
||||
roomIntentTap.action = actionIds.tapToView
|
||||
// pending intent get reused by system, this will mess up the extra params, so put unique info to avoid that
|
||||
roomIntentTap.data = createIgnoredUri("openRoom?$roomId")
|
||||
|
||||
|
@ -853,7 +853,7 @@ class NotificationUtils @Inject constructor(
|
|||
val intent: Intent
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
intent = Intent(context, NotificationBroadcastReceiver::class.java)
|
||||
intent.action = actionIds.SMART_REPLY_ACTION
|
||||
intent.action = actionIds.smartReply
|
||||
intent.data = createIgnoredUri(roomId)
|
||||
intent.putExtra(NotificationBroadcastReceiver.KEY_ROOM_ID, roomId)
|
||||
return PendingIntent.getBroadcast(
|
||||
|
@ -929,7 +929,7 @@ class NotificationUtils @Inject constructor(
|
|||
|
||||
private fun getDismissSummaryPendingIntent(): PendingIntent {
|
||||
val intent = Intent(context, NotificationBroadcastReceiver::class.java)
|
||||
intent.action = actionIds.DISMISS_SUMMARY_ACTION
|
||||
intent.action = actionIds.dismissSummary
|
||||
intent.data = createIgnoredUri("deleteSummary")
|
||||
return PendingIntent.getBroadcast(
|
||||
context.applicationContext,
|
||||
|
@ -968,7 +968,7 @@ class NotificationUtils @Inject constructor(
|
|||
|
||||
fun displayDiagnosticNotification() {
|
||||
val testActionIntent = Intent(context, TestNotificationReceiver::class.java)
|
||||
testActionIntent.action = actionIds.DIAGNOSTIC_ACTION
|
||||
testActionIntent.action = actionIds.diagnostic
|
||||
val testPendingIntent = PendingIntent.getBroadcast(
|
||||
context,
|
||||
0,
|
||||
|
|
|
@ -152,11 +152,11 @@ class VectorSettingsNotificationsTroubleshootFragment @Inject constructor(
|
|||
|
||||
tryOrNull("Unable to register the receiver") {
|
||||
LocalBroadcastManager.getInstance(requireContext())
|
||||
.registerReceiver(broadcastReceiverPush, IntentFilter(actionIds.PUSH_ACTION))
|
||||
.registerReceiver(broadcastReceiverPush, IntentFilter(actionIds.push))
|
||||
}
|
||||
tryOrNull("Unable to register the receiver") {
|
||||
LocalBroadcastManager.getInstance(requireContext())
|
||||
.registerReceiver(broadcastReceiverNotification, IntentFilter(actionIds.DIAGNOSTIC_ACTION))
|
||||
.registerReceiver(broadcastReceiverNotification, IntentFilter(actionIds.diagnostic))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue