mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-24 16:57:50 +00:00
Show blocked dialog if needed
This commit is contained in:
parent
12b008c61c
commit
8cb4c267c5
@ -672,6 +672,10 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
|
||||
}
|
||||
|
||||
override fun sendMessage() {
|
||||
if (thread.isContactRecipient && thread.isBlocked) {
|
||||
BlockedDialog(thread).show(supportFragmentManager, "Blocked Dialog")
|
||||
return
|
||||
}
|
||||
if (inputBar.linkPreview != null || inputBar.quote != null) {
|
||||
sendAttachments(listOf(), getMessageBody(), inputBar.quote, inputBar.linkPreview)
|
||||
} else {
|
||||
|
@ -13,6 +13,7 @@ import org.session.libsession.messaging.contacts.Contact
|
||||
import org.session.libsession.utilities.recipients.Recipient
|
||||
import org.thoughtcrime.securesms.conversation.v2.utilities.BaseDialog
|
||||
import org.thoughtcrime.securesms.database.DatabaseFactory
|
||||
import org.thoughtcrime.securesms.database.RecipientDatabase
|
||||
|
||||
/** Shown upon sending a message to a user that's blocked. */
|
||||
class BlockedDialog(private val recipient: Recipient) : BaseDialog() {
|
||||
@ -36,6 +37,7 @@ class BlockedDialog(private val recipient: Recipient) : BaseDialog() {
|
||||
}
|
||||
|
||||
private fun unblock() {
|
||||
// TODO: Implement
|
||||
DatabaseFactory.getRecipientDatabase(requireContext()).setBlocked(recipient, false)
|
||||
dismiss()
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user