mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-11 14:54:09 +01:00
Merge pull request #1295 from nextcloud/bug/1281/noDeletionForAttachments
dont show deletion option for attachments
This commit is contained in:
commit
634a2fa34f
@ -1800,6 +1800,8 @@ class ChatController(args: Bundle) :
|
|||||||
|
|
||||||
if (message.isDeleted) return false
|
if (message.isDeleted) return false
|
||||||
|
|
||||||
|
if (message.hasFileAttachment()) return false
|
||||||
|
|
||||||
val sixHoursInMillis = 6 * 3600 * 1000
|
val sixHoursInMillis = 6 * 3600 * 1000
|
||||||
val isOlderThanSixHours = message.createdAt?.before(Date(System.currentTimeMillis() - sixHoursInMillis)) == true
|
val isOlderThanSixHours = message.createdAt?.before(Date(System.currentTimeMillis() - sixHoursInMillis)) == true
|
||||||
if (isOlderThanSixHours) return false
|
if (isOlderThanSixHours) return false
|
||||||
|
@ -91,7 +91,7 @@ public class ChatMessage implements IMessage, MessageContentType, MessageContent
|
|||||||
MessageType.SYSTEM_MESSAGE, MessageType.SINGLE_LINK_VIDEO_MESSAGE,
|
MessageType.SYSTEM_MESSAGE, MessageType.SINGLE_LINK_VIDEO_MESSAGE,
|
||||||
MessageType.SINGLE_LINK_AUDIO_MESSAGE, MessageType.SINGLE_LINK_MESSAGE);
|
MessageType.SINGLE_LINK_AUDIO_MESSAGE, MessageType.SINGLE_LINK_MESSAGE);
|
||||||
|
|
||||||
private boolean hasFileAttachment() {
|
public boolean hasFileAttachment() {
|
||||||
if (messageParameters != null && messageParameters.size() > 0) {
|
if (messageParameters != null && messageParameters.size() > 0) {
|
||||||
for (String key : messageParameters.keySet()) {
|
for (String key : messageParameters.keySet()) {
|
||||||
Map<String, String> individualHashMap = messageParameters.get(key);
|
Map<String, String> individualHashMap = messageParameters.get(key);
|
||||||
@ -100,7 +100,6 @@ public class ChatMessage implements IMessage, MessageContentType, MessageContent
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user