From 47af97be57ebea88713676ff18104b48e1f71927 Mon Sep 17 00:00:00 2001 From: nielsandriesse Date: Thu, 3 Sep 2020 17:23:23 +1000 Subject: [PATCH] Fix inverted flag --- res/values/strings.xml | 1 - src/org/thoughtcrime/securesms/loki/api/PublicChatPoller.kt | 3 ++- src/org/thoughtcrime/securesms/mms/Slide.java | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index c56c0332cf..674ce114f2 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -1862,7 +1862,6 @@ Copy Session ID - Attachment Voice Message diff --git a/src/org/thoughtcrime/securesms/loki/api/PublicChatPoller.kt b/src/org/thoughtcrime/securesms/loki/api/PublicChatPoller.kt index 443cc84a59..147b01400c 100644 --- a/src/org/thoughtcrime/securesms/loki/api/PublicChatPoller.kt +++ b/src/org/thoughtcrime/securesms/loki/api/PublicChatPoller.kt @@ -189,7 +189,8 @@ class PublicChatPoller(private val context: Context, private val group: PublicCh val messageID = DatabaseFactory.getLokiMessageDatabase(context).getMessageID(messageServerID) var isDuplicate = false if (messageID != null) { - isDuplicate = DatabaseFactory.getMmsDatabase(context).getThreadIdForMessage(messageID) > 0 || DatabaseFactory.getSmsDatabase(context).getThreadIdForMessage(messageID) > 0 + isDuplicate = DatabaseFactory.getMmsDatabase(context).getThreadIdForMessage(messageID) > 0 + || DatabaseFactory.getSmsDatabase(context).getThreadIdForMessage(messageID) > 0 } if (isDuplicate) { return } if (message.body.isEmpty() && message.attachments.isEmpty() && message.quote == null) { return } diff --git a/src/org/thoughtcrime/securesms/mms/Slide.java b/src/org/thoughtcrime/securesms/mms/Slide.java index fe9a7a9b77..cdf5ce5456 100644 --- a/src/org/thoughtcrime/securesms/mms/Slide.java +++ b/src/org/thoughtcrime/securesms/mms/Slide.java @@ -63,9 +63,10 @@ public abstract class Slide { String attachmentString = context.getString(R.string.attachment); if (MediaUtil.isAudio(attachment)) { - // a missing filename is the legacy way to determine if an audio attachment is + // A missing file name is the legacy way to determine if an audio attachment is // a voice note vs. other arbitrary audio attachments. - if (attachment.isVoiceNote() || !attachment.getFileName().isEmpty()) { + if (attachment.isVoiceNote() || attachment.getFileName() == null || + attachment.getFileName().isEmpty()) { attachmentString = context.getString(R.string.attachment_type_voice_message); return Optional.fromNullable("🎤 " + attachmentString); }