Fix inverted flag

This commit is contained in:
nielsandriesse 2020-09-03 17:23:23 +10:00
parent fe85236167
commit 47af97be57
3 changed files with 5 additions and 4 deletions

View File

@ -1862,7 +1862,6 @@
<string name="activity_conversation_menu_copy_session_id">Copy Session ID</string> <string name="activity_conversation_menu_copy_session_id">Copy Session ID</string>
<!-- Attachment message -->
<string name="attachment">Attachment</string> <string name="attachment">Attachment</string>
<string name="attachment_type_voice_message">Voice Message</string> <string name="attachment_type_voice_message">Voice Message</string>

View File

@ -189,7 +189,8 @@ class PublicChatPoller(private val context: Context, private val group: PublicCh
val messageID = DatabaseFactory.getLokiMessageDatabase(context).getMessageID(messageServerID) val messageID = DatabaseFactory.getLokiMessageDatabase(context).getMessageID(messageServerID)
var isDuplicate = false var isDuplicate = false
if (messageID != null) { 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 (isDuplicate) { return }
if (message.body.isEmpty() && message.attachments.isEmpty() && message.quote == null) { return } if (message.body.isEmpty() && message.attachments.isEmpty() && message.quote == null) { return }

View File

@ -63,9 +63,10 @@ public abstract class Slide {
String attachmentString = context.getString(R.string.attachment); String attachmentString = context.getString(R.string.attachment);
if (MediaUtil.isAudio(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. // 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); attachmentString = context.getString(R.string.attachment_type_voice_message);
return Optional.fromNullable("🎤 " + attachmentString); return Optional.fromNullable("🎤 " + attachmentString);
} }