mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-18 13:00:18 +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."
|
isAudioMessage() -> "sent an audio file."
|
||||||
isImageMessage() -> "sent an image."
|
isImageMessage() -> "sent an image."
|
||||||
isVideoMessage() -> "sent a video."
|
isVideoMessage() -> "sent a video."
|
||||||
|
isPoll() -> "created a poll."
|
||||||
else -> text
|
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
|
fun Event.isSticker(): Boolean = getClearType() == EventType.STICKER
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ internal class RealmSessionStoreMigration @Inject constructor(
|
||||||
) : RealmMigration {
|
) : RealmMigration {
|
||||||
|
|
||||||
companion object {
|
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() {
|
override fun onAddAttachment() {
|
||||||
if (!::attachmentTypeSelector.isInitialized) {
|
if (!::attachmentTypeSelector.isInitialized) {
|
||||||
attachmentTypeSelector = AttachmentTypeSelectorView(vectorBaseActivity, vectorBaseActivity.layoutInflater, this@TimelineFragment)
|
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)
|
attachmentTypeSelector.show(views.composerLayout.views.attachmentButton, keyboardStateUtils.isKeyboardShowing)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue