Преглед изворни кода

Fix #369

Signed-off-by: Mario Danic <mario@lovelyhq.com>
Mario Danic пре 6 година
родитељ
комит
60b340ce89

+ 4 - 1
app/src/main/java/com/nextcloud/talk/jobs/NotificationWorker.java

@@ -266,6 +266,9 @@ public class NotificationWorker extends Worker {
 
         CRC32 crc32 = new CRC32();
 
+        String baseUrl =
+                signatureVerification.getUserEntity().getBaseUrl().substring(signatureVerification.getUserEntity().getBaseUrl().indexOf("://") + 3);
+
         NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(context, "1")
                 .setLargeIcon(largeIcon)
                 .setSmallIcon(smallIcon)
@@ -273,7 +276,7 @@ public class NotificationWorker extends Worker {
                 .setPriority(priority)
                 .setWhen(Calendar.getInstance().getTimeInMillis())
                 .setShowWhen(true)
-                .setSubText(signatureVerification.getUserEntity().getDisplayName())
+                .setSubText(baseUrl)
                 .setContentTitle(decryptedPushMessage.getSubject())
                 .setContentIntent(pendingIntent)
                 .setAutoCancel(true);

+ 1 - 1
app/src/main/java/com/nextcloud/talk/utils/NotificationUtils.java

@@ -59,7 +59,7 @@ public class NotificationUtils {
 
             channel.setDescription(channelDescription);
             channel.enableLights(enableLights);
-            channel.setLightColor(Color.RED);
+            channel.setLightColor(R.color.colorPrimary);
             channel.setSound(null, null);
 
             notificationManager.createNotificationChannel(channel);