No Edit Time limit on Note to Self

Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
This commit is contained in:
sowjanyakch 2024-08-29 09:03:44 +02:00
parent 401ded4f83
commit 2636979136
No known key found for this signature in database
GPG Key ID: F7AA2A8B65B50220
2 changed files with 10 additions and 3 deletions

View File

@ -87,12 +87,18 @@ class MessageActionsDialog(
.before(Date(System.currentTimeMillis() - AGE_THRESHOLD_FOR_EDIT_MESSAGE))
private val isUserAllowedToEdit = chatActivity.userAllowedByPrivilages(message)
private val isMessageEditable = hasSpreedFeatureCapability(
private var isNoTimeLimitOnNoteToSelf = hasSpreedFeatureCapability(
spreedCapabilities,
SpreedFeatures
.EDIT_MESSAGES_NOTE_TO_SELF
) && currentConversation?.type == ConversationEnums.ConversationType.NOTE_TO_SELF
private var messageIsEditable = hasSpreedFeatureCapability(
spreedCapabilities,
SpreedFeatures.EDIT_MESSAGES
) && messageHasRegularText && !isOlderThanTwentyFourHours && isUserAllowedToEdit
private val isMessageEditable = isNoTimeLimitOnNoteToSelf || messageIsEditable
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
NextcloudTalkApplication.sharedApplication?.componentApplication?.inject(this)

View File

@ -54,7 +54,8 @@ enum class SpreedFeatures(val value: String) {
CONVERSATION_PERMISSION("conversation-permissions"),
FEDERATION_V1("federation-v1"),
DELETE_MESSAGES_UNLIMITED("delete-messages-unlimited"),
BAN_V1("ban-v1")
BAN_V1("ban-v1"),
EDIT_MESSAGES_NOTE_TO_SELF("edit-messages-note-to-self")
}
@Suppress("TooManyFunctions")