mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-16 02:05:06 +08: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
@ -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 New Issue
Block a user