mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-26 23:25:20 +03:00
Merge pull request #1295 from nextcloud/bug/1281/noDeletionForAttachments
dont show deletion option for attachments
This commit is contained in:
commit
634a2fa34f
2 changed files with 3 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue