Skip to content

Commit

Permalink
No Edit Time limit on Note to Self
Browse files Browse the repository at this point in the history
Signed-off-by: sowjanyakch <[email protected]>
  • Loading branch information
sowjanyakch committed Aug 29, 2024
1 parent 401ded4 commit 2636979
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 2636979

Please sign in to comment.