Merge pull request #4122 from nextcloud/edit_note_to_self

No Edit Time limit on Note to Self Messages
This commit is contained in:
Julius Linus 2024-08-29 07:14:08 -05:00 committed by GitHub
commit 23eb15f121
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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")