More clean up

Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2020-02-23 23:26:26 +01:00
parent 8307b48213
commit eb18269ec9
No known key found for this signature in database
GPG Key ID: CDE0BBD2738C4CC0

View File

@ -196,9 +196,6 @@ class MessageNotificationWorker(
} }
} }
val adjustedConversationType = conversationType
?: Conversation.ConversationType.ONE_TO_ONE_CONVERSATION
val pendingIntent: PendingIntent? = PendingIntent.getActivity(applicationContext, val pendingIntent: PendingIntent? = PendingIntent.getActivity(applicationContext,
0, intent, 0) 0, intent, 0)
@ -291,13 +288,13 @@ class MessageNotificationWorker(
override fun onSuccess(result: Drawable) { override fun onSuccess(result: Drawable) {
super.onSuccess(result) super.onSuccess(result)
person.setIcon(IconCompat.createWithBitmap(result.toBitmap())) person.setIcon(IconCompat.createWithBitmap(result.toBitmap()))
notificationBuilder.setStyle(getStyle(decryptedPushMessage, adjustedConversationType, person.build(), style)) notificationBuilder.setStyle(getStyle(decryptedPushMessage, conversationType, person.build(), style))
NotificationManagerCompat.from(applicationContext).notify(notificationId, notificationBuilder.build()) NotificationManagerCompat.from(applicationContext).notify(notificationId, notificationBuilder.build())
} }
override fun onError(error: Drawable?) { override fun onError(error: Drawable?) {
super.onError(error) super.onError(error)
notificationBuilder.setStyle(getStyle(decryptedPushMessage, adjustedConversationType, person.build(), style)) notificationBuilder.setStyle(getStyle(decryptedPushMessage, conversationType, person.build(), style))
NotificationManagerCompat.from(applicationContext).notify(notificationId, notificationBuilder.build()) NotificationManagerCompat.from(applicationContext).notify(notificationId, notificationBuilder.build())
} }
} }
@ -309,7 +306,7 @@ class MessageNotificationWorker(
componentsWithEmptyCookieJar.getImageLoader().load(request) componentsWithEmptyCookieJar.getImageLoader().load(request)
} else { } else {
notificationBuilder.setStyle(getStyle(decryptedPushMessage, adjustedConversationType, person.build(), style)) notificationBuilder.setStyle(getStyle(decryptedPushMessage, conversationType, person.build(), style))
NotificationManagerCompat.from(applicationContext).notify(notificationId, notificationBuilder.build()) NotificationManagerCompat.from(applicationContext).notify(notificationId, notificationBuilder.build())
} }
} }