Skip to content

Commit 52a4030

Browse files
committed
do not set large icon when failed to get nc notification
... the ugly "fallback" icons should not be shown in this case Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
1 parent 8285d17 commit 52a4030

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

app/src/main/java/com/nextcloud/talk/jobs/NotificationWorker.kt

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,19 @@ class NotificationWorker(context: Context, workerParams: WorkerParameters) : Wor
512512
val autoCancelOnClick = TYPE_RECORDING != pushMessage.type
513513

514514
val notificationBuilder =
515-
createNotificationBuilder(category, contentTitle, contentText, baseUrl, pendingIntent, autoCancelOnClick)
515+
createNotificationBuilder(
516+
category,
517+
contentTitle,
518+
contentText,
519+
baseUrl,
520+
pendingIntent,
521+
autoCancelOnClick
522+
)
523+
524+
if (ncNotification != null) {
525+
notificationBuilder.setLargeIcon(getLargeIcon())
526+
}
527+
516528
val activeStatusBarNotification = findNotificationForRoom(
517529
context,
518530
signatureVerification.user!!,
@@ -551,7 +563,6 @@ class NotificationWorker(context: Context, workerParams: WorkerParameters) : Wor
551563
val notificationBuilder = NotificationCompat.Builder(context!!, "1")
552564
.setPriority(NotificationCompat.PRIORITY_HIGH)
553565
.setCategory(category)
554-
.setLargeIcon(getLargeIcon())
555566
.setSmallIcon(R.drawable.ic_notification)
556567
.setContentTitle(contentTitle)
557568
.setContentText(contentText)

0 commit comments

Comments
 (0)