Skip to content

Commit 7cb004e

Browse files
committed
don't show silent option similar to chat messages
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
1 parent ed9c6a0 commit 7cb004e

File tree

4 files changed

+7
-34
lines changed

4 files changed

+7
-34
lines changed

app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3685,12 +3685,8 @@ class ChatActivity :
36853685
startActivity(intent)
36863686
}
36873687

3688-
fun showScheduleMessageDialog(message: String, sendWithoutNotification: Boolean, showSilentOption: Boolean) {
3688+
fun showScheduleMessageDialog(message: String, sendWithoutNotification: Boolean) {
36893689
val shouldDismiss = mutableStateOf(false)
3690-
val canSendSilent = CapabilitiesUtil.hasSpreedFeatureCapability(
3691-
spreedCapabilities,
3692-
SpreedFeatures.SILENT_SEND
3693-
)
36943690
binding.genericComposeView.setContent {
36953691
ScheduleMessageCompose(
36963692
initialMessage = message,
@@ -3713,8 +3709,7 @@ class ChatActivity :
37133709
sendAt = sendAt
37143710
)
37153711
},
3716-
defaultSendWithoutNotification = sendWithoutNotification,
3717-
showSilentOption = showSilentOption && canSendSilent
3712+
defaultSendWithoutNotification = sendWithoutNotification
37183713
).GetScheduleDialog(shouldDismiss, this@ChatActivity)
37193714
}
37203715
}

app/src/main/java/com/nextcloud/talk/chat/MessageInputFragment.kt

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -776,11 +776,7 @@ class MessageInputFragment : Fragment() {
776776
}
777777
}
778778

779-
private fun scheduleMessage() {
780-
scheduleMessage(sendWithoutNotification = false, showSilentOption = true)
781-
}
782-
783-
private fun scheduleMessage(sendWithoutNotification: Boolean, showSilentOption: Boolean) {
779+
private fun scheduleMessage(sendWithoutNotification: Boolean) {
784780
if (binding.fragmentMessageInputView.inputEditText != null) {
785781
val editable = binding.fragmentMessageInputView.inputEditText!!.editableText
786782
replaceMentionChipSpans(editable)
@@ -792,8 +788,7 @@ class MessageInputFragment : Fragment() {
792788
sendStopTypingMessage()
793789
chatActivity.showScheduleMessageDialog(
794790
message = message,
795-
sendWithoutNotification = sendWithoutNotification,
796-
showSilentOption = showSilentOption
791+
sendWithoutNotification = sendWithoutNotification
797792
)
798793
cancelReply()
799794
cancelCreateThread()
@@ -1045,10 +1040,10 @@ class MessageInputFragment : Fragment() {
10451040
when (item.itemId) {
10461041
R.id.send_without_notification -> submitMessage(true)
10471042
R.id.send_later -> {
1048-
scheduleMessage(sendWithoutNotification = false, showSilentOption = false)
1043+
scheduleMessage(sendWithoutNotification = false)
10491044
}
10501045
R.id.send_later_without_notification -> {
1051-
scheduleMessage(sendWithoutNotification = true, showSilentOption = false)
1046+
scheduleMessage(sendWithoutNotification = true)
10521047
}
10531048
}
10541049
true

app/src/main/java/com/nextcloud/talk/chat/ScheduleMessageCompose.kt

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ class ScheduleMessageCompose(
7272
private val onDismiss: () -> Unit,
7373
private val onSchedule: (Long, Boolean) -> Unit,
7474
private val defaultSendWithoutNotification: Boolean,
75-
private val showSilentOption: Boolean,
7675
private val viewThemeUtils: ViewThemeUtils
7776
) {
7877
private val timeState = mutableStateOf(initialTime())
@@ -151,21 +150,6 @@ class ScheduleMessageCompose(
151150
Text(stringResource(R.string.nc_schedule_message))
152151
}
153152
}
154-
155-
if (showSilentOption) {
156-
TextButton(
157-
onClick = {
158-
val offset = timeState.value.atZone(ZoneOffset.systemDefault()).offset
159-
val timeVal = timeState.value.toEpochSecond(offset)
160-
onSchedule(timeVal, true)
161-
shouldDismiss.value = true
162-
onDismiss()
163-
},
164-
modifier = Modifier.fillMaxWidth()
165-
) {
166-
Text(stringResource(R.string.nc_schedule_message_without_notification))
167-
}
168-
}
169153
}
170154
}
171155

app/src/main/java/com/nextcloud/talk/chat/ScheduledMessagesActivity.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,8 +437,7 @@ class ScheduledMessagesActivity : BaseActivity() {
437437
shouldDismiss.value = true
438438
showScheduleDialogFor = null
439439
},
440-
defaultSendWithoutNotification = message.silent,
441-
showSilentOption = false
440+
defaultSendWithoutNotification = message.silent
442441
).GetScheduleDialog(shouldDismiss, LocalContext.current)
443442
}
444443
}

0 commit comments

Comments
 (0)