Merge pull request #1295 from nextcloud/bug/1281/noDeletionForAttachments

dont show deletion option for attachments
This commit is contained in:
Andy Scherzinger 2021-05-27 11:51:58 +02:00 committed by GitHub
commit 634a2fa34f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -1800,6 +1800,8 @@ class ChatController(args: Bundle) :
if (message.isDeleted) return false
if (message.hasFileAttachment()) return false
val sixHoursInMillis = 6 * 3600 * 1000
val isOlderThanSixHours = message.createdAt?.before(Date(System.currentTimeMillis() - sixHoursInMillis)) == true
if (isOlderThanSixHours) return false

View file

@ -91,7 +91,7 @@ public class ChatMessage implements IMessage, MessageContentType, MessageContent
MessageType.SYSTEM_MESSAGE, MessageType.SINGLE_LINK_VIDEO_MESSAGE,
MessageType.SINGLE_LINK_AUDIO_MESSAGE, MessageType.SINGLE_LINK_MESSAGE);
private boolean hasFileAttachment() {
public boolean hasFileAttachment() {
if (messageParameters != null && messageParameters.size() > 0) {
for (String key : messageParameters.keySet()) {
Map<String, String> individualHashMap = messageParameters.get(key);
@ -100,7 +100,6 @@ public class ChatMessage implements IMessage, MessageContentType, MessageContent
}
}
}
return false;
}