mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 04:58:45 +00:00
Add sticker suggestion send support to CFV2.
This commit is contained in:
committed by
Cody Henthorne
parent
441e30971a
commit
3d4875bcfe
@@ -209,6 +209,7 @@ import org.thoughtcrime.securesms.mms.QuoteModel
|
||||
import org.thoughtcrime.securesms.mms.Slide
|
||||
import org.thoughtcrime.securesms.mms.SlideDeck
|
||||
import org.thoughtcrime.securesms.mms.SlideFactory
|
||||
import org.thoughtcrime.securesms.mms.StickerSlide
|
||||
import org.thoughtcrime.securesms.notifications.v2.ConversationId
|
||||
import org.thoughtcrime.securesms.payments.preferences.PaymentsActivity
|
||||
import org.thoughtcrime.securesms.permissions.Permissions
|
||||
@@ -1075,6 +1076,22 @@ class ConversationFragment :
|
||||
}
|
||||
}
|
||||
|
||||
private fun sendSticker(
|
||||
stickerRecord: StickerRecord,
|
||||
clearCompose: Boolean
|
||||
) {
|
||||
val stickerLocator = StickerLocator(stickerRecord.packId, stickerRecord.packKey, stickerRecord.stickerId, stickerRecord.emoji)
|
||||
val slide = StickerSlide(
|
||||
requireContext(),
|
||||
stickerRecord.uri,
|
||||
stickerRecord.size,
|
||||
stickerLocator,
|
||||
stickerRecord.contentType
|
||||
)
|
||||
|
||||
sendMessageWithoutComposeInput(slide, clearCompose = clearCompose)
|
||||
}
|
||||
|
||||
private fun sendMessageWithoutComposeInput(
|
||||
slide: Slide? = null,
|
||||
contacts: List<Contact> = emptyList(),
|
||||
@@ -2766,7 +2783,10 @@ class ConversationFragment :
|
||||
}
|
||||
|
||||
override fun onStickerSuggestionSelected(sticker: StickerRecord) {
|
||||
// TODO [cfv2] Not yet implemented
|
||||
sendSticker(
|
||||
stickerRecord = sticker,
|
||||
clearCompose = true
|
||||
)
|
||||
}
|
||||
|
||||
override fun onQuoteChanged(id: Long, author: RecipientId) {
|
||||
@@ -2778,12 +2798,14 @@ class ConversationFragment :
|
||||
}
|
||||
|
||||
override fun onEnterEditMode() {
|
||||
// TODO [cfv2] Not yet implemented
|
||||
updateToggleButtonState()
|
||||
// TODO [cfv2] -- Save keyboard pager state and force emoji
|
||||
}
|
||||
|
||||
override fun onExitEditMode() {
|
||||
updateToggleButtonState()
|
||||
draftViewModel.deleteMessageEditDraft()
|
||||
// TODO [cfv2] -- Restore keyboard pager pages
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user