mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-26 03:16:02 +03:00
Disable polls from within threads but allow users to vote if the poll is a root thread message
This commit is contained in:
parent
20357ce5c4
commit
3acdccb339
3 changed files with 6 additions and 3 deletions
|
@ -205,6 +205,7 @@ data class Event(
|
|||
isAudioMessage() -> "sent an audio file."
|
||||
isImageMessage() -> "sent an image."
|
||||
isVideoMessage() -> "sent a video."
|
||||
isPoll() -> "created a poll."
|
||||
else -> text
|
||||
}
|
||||
}
|
||||
|
@ -337,7 +338,7 @@ fun Event.isAttachmentMessage(): Boolean {
|
|||
}
|
||||
}
|
||||
|
||||
fun Event.isPoll(): Boolean = getClearType() == EventType.POLL_START || getClearType() == EventType.POLL_END
|
||||
fun Event.isPoll(): Boolean = getClearType() == EventType.POLL_START || getClearType() == EventType.POLL_END
|
||||
|
||||
fun Event.isSticker(): Boolean = getClearType() == EventType.STICKER
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ internal class RealmSessionStoreMigration @Inject constructor(
|
|||
) : RealmMigration {
|
||||
|
||||
companion object {
|
||||
const val SESSION_STORE_SCHEMA_VERSION = 19L
|
||||
const val SESSION_STORE_SCHEMA_VERSION = 20L
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1448,7 +1448,9 @@ class TimelineFragment @Inject constructor(
|
|||
override fun onAddAttachment() {
|
||||
if (!::attachmentTypeSelector.isInitialized) {
|
||||
attachmentTypeSelector = AttachmentTypeSelectorView(vectorBaseActivity, vectorBaseActivity.layoutInflater, this@TimelineFragment)
|
||||
attachmentTypeSelector.setAttachmentVisibility(AttachmentTypeSelectorView.Type.POLL, vectorPreferences.labsEnablePolls())
|
||||
attachmentTypeSelector.setAttachmentVisibility(
|
||||
AttachmentTypeSelectorView.Type.POLL,
|
||||
vectorPreferences.labsEnablePolls() && !isThreadTimeLine())
|
||||
}
|
||||
attachmentTypeSelector.show(views.composerLayout.views.attachmentButton, keyboardStateUtils.isKeyboardShowing)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue