mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-26 15:05:44 +03:00
Merge pull request #1936 from nextcloud/bugfix/1935/fixReactionNotificationSubject
fix text for reaction notification + hide content title for one2one rooms and reactions
This commit is contained in:
commit
30d57fda4f
1 changed files with 13 additions and 4 deletions
|
@ -78,6 +78,7 @@ import java.security.InvalidKeyException;
|
|||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.PrivateKey;
|
||||
import java.util.HashMap;
|
||||
import java.util.Objects;
|
||||
import java.util.zip.CRC32;
|
||||
|
||||
import javax.crypto.Cipher;
|
||||
|
@ -224,10 +225,13 @@ public class NotificationWorker extends Worker {
|
|||
HashMap<String, String> guestHashMap = subjectRichParameters.get("guest");
|
||||
|
||||
if (callHashMap != null && callHashMap.size() > 0 && callHashMap.containsKey("name")) {
|
||||
if (notification.getObjectType().equals("chat")) {
|
||||
decryptedPushMessage.setSubject(callHashMap.get("name"));
|
||||
if (subjectRichParameters.containsKey("reaction")) {
|
||||
decryptedPushMessage.setSubject("");
|
||||
decryptedPushMessage.setText(notification.getSubject());
|
||||
} else if (Objects.equals(notification.getObjectType(), "chat")) {
|
||||
decryptedPushMessage.setSubject(Objects.requireNonNull(callHashMap.get("name")));
|
||||
} else {
|
||||
decryptedPushMessage.setSubject(notification.getSubject());
|
||||
decryptedPushMessage.setSubject(Objects.requireNonNull(notification.getSubject()));
|
||||
}
|
||||
|
||||
if (callHashMap.containsKey("call-type")) {
|
||||
|
@ -278,6 +282,8 @@ public class NotificationWorker extends Worker {
|
|||
}
|
||||
|
||||
switch (conversationType) {
|
||||
case "one2one":
|
||||
decryptedPushMessage.setSubject("");
|
||||
case "group":
|
||||
largeIcon = BitmapFactory.decodeResource(context.getResources(), R.drawable.ic_people_group_black_24px);
|
||||
break;
|
||||
|
@ -309,10 +315,13 @@ public class NotificationWorker extends Worker {
|
|||
.setSubText(baseUrl)
|
||||
.setWhen(decryptedPushMessage.getTimestamp())
|
||||
.setShowWhen(true)
|
||||
.setContentTitle(EmojiCompat.get().process(decryptedPushMessage.getSubject()))
|
||||
.setContentIntent(pendingIntent)
|
||||
.setAutoCancel(true);
|
||||
|
||||
if (!TextUtils.isEmpty(decryptedPushMessage.getSubject())) {
|
||||
notificationBuilder.setContentTitle(EmojiCompat.get().process(decryptedPushMessage.getSubject()));
|
||||
}
|
||||
|
||||
if (!TextUtils.isEmpty(decryptedPushMessage.getText())) {
|
||||
notificationBuilder.setContentText(EmojiCompat.get().process(decryptedPushMessage.getText()));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue