Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions src/components/NewMessage/NewMessage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@
:disabled="disabled"
forceMenu
:primary="silentChat"
@close="submenu = null">
:open="isNcActionsOpen"
@close="submenu = null; isNcActionsOpen = false">
<template #icon>
<IconBellOffOutline v-if="silentChat" :size="20" />
</template>
Expand Down Expand Up @@ -518,6 +519,7 @@ export default {
preservedSelectionRange: null,

/* Schedule messages feature local state */
isNcActionsOpen: false,
submenu: null,
customScheduleTimestamp: null,
isScheduling: false,
Expand Down Expand Up @@ -602,20 +604,20 @@ export default {
canShareFiles() {
return !this.actorStore.isActorGuest
&& !this.conversation.remoteServer // no attachments support in federated conversations
&& !this.scheduleMessageTime
&& !this.scheduleMessageTime && !this.showScheduledMessages
},

canUploadFiles() {
// TODO attachments should be allowed on both instances?
return getTalkConfig(this.token, 'attachments', 'allowed') && this.canShareFiles
&& this.settingsStore.attachmentFolderFreeSpace !== 0
&& !this.scheduleMessageTime
&& !this.scheduleMessageTime && !this.showScheduledMessages
},

canCreatePoll() {
return !this.isOneToOne && !this.noChatPermission
&& this.conversation.type !== CONVERSATION.TYPE.NOTE_TO_SELF
&& !this.scheduleMessageTime
&& !this.scheduleMessageTime && !this.showScheduledMessages
},

currentConversationIsJoined() {
Expand Down Expand Up @@ -659,7 +661,9 @@ export default {
},

showAudioRecorder() {
return !this.hasText && this.canUploadFiles && !this.broadcast && !this.upload && !this.messageToEdit && !this.threadCreating && !this.scheduleMessageTime
return !this.hasText && this.canUploadFiles && !this.broadcast && !this.upload
&& !this.messageToEdit && !this.threadCreating
&& !this.scheduleMessageTime && !this.showScheduledMessages
},

showTypingStatus() {
Expand Down Expand Up @@ -862,6 +866,7 @@ export default {
this.clearTypingInterval()
this.checkAbsenceStatus()
this.clearSilentState()
this.chatExtrasStore.setScheduleMessageTime(null)
},
},

Expand Down Expand Up @@ -1016,6 +1021,13 @@ export default {
return
}

if (supportScheduleMessages && !this.scheduleMessageTime && this.showScheduledMessages) {
// Block sending and prompt user to pick a time for scheduling
this.submenu = 'schedule'
this.isNcActionsOpen = true
return
}

// Clear input content from store
this.debouncedUpdateChatInput.clear()
this.chatExtrasStore.removeChatInput(this.token)
Expand Down
2 changes: 1 addition & 1 deletion src/components/NewMessage/NewMessageUploadEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<template>
<NcModal
v-if="showModal"
ref="modal"
:id="dialogMaskId"
ref="modal"
:size="isVoiceMessage ? 'small' : 'normal'"
:labelId="dialogHeaderId"
@close="handleDismiss">
Expand Down