Skip to content

Commit

Permalink
Merge pull request #4122 from nextcloud/edit_note_to_self
Browse files Browse the repository at this point in the history
No Edit Time limit on Note to Self Messages
  • Loading branch information
rapterjet2004 committed Aug 29, 2024
2 parents 401ded4 + 2636979 commit 23eb15f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 23eb15f

Please sign in to comment.