mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-25 02:55:23 +00:00
Merge remote-tracking branch 'upstream/master' into dev
This commit is contained in:
commit
443ddfa370
@ -1605,7 +1605,12 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
|
|||||||
return Pair(recipient.address, sentTimestamp)
|
return Pair(recipient.address, sentTimestamp)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun sendAttachments(attachments: List<Attachment>, body: String?, quotedMessage: MessageRecord? = null, linkPreview: LinkPreview? = null): Pair<Address, Long>? {
|
private fun sendAttachments(
|
||||||
|
attachments: List<Attachment>,
|
||||||
|
body: String?,
|
||||||
|
quotedMessage: MessageRecord? = binding?.inputBar?.quote,
|
||||||
|
linkPreview: LinkPreview? = null
|
||||||
|
): Pair<Address, Long>? {
|
||||||
val recipient = viewModel.recipient ?: return null
|
val recipient = viewModel.recipient ?: return null
|
||||||
val sentTimestamp = SnodeAPI.nowWithOffset
|
val sentTimestamp = SnodeAPI.nowWithOffset
|
||||||
processMessageRequestApproval()
|
processMessageRequestApproval()
|
||||||
|
@ -10,6 +10,7 @@ import com.goterl.lazysodium.utils.Key
|
|||||||
import dagger.hilt.android.qualifiers.ApplicationContext
|
import dagger.hilt.android.qualifiers.ApplicationContext
|
||||||
import kotlinx.serialization.decodeFromString
|
import kotlinx.serialization.decodeFromString
|
||||||
import kotlinx.serialization.json.Json
|
import kotlinx.serialization.json.Json
|
||||||
|
import kotlinx.serialization.json.JsonBuilder
|
||||||
import org.session.libsession.messaging.jobs.BatchMessageReceiveJob
|
import org.session.libsession.messaging.jobs.BatchMessageReceiveJob
|
||||||
import org.session.libsession.messaging.jobs.JobQueue
|
import org.session.libsession.messaging.jobs.JobQueue
|
||||||
import org.session.libsession.messaging.jobs.MessageReceiveParameters
|
import org.session.libsession.messaging.jobs.MessageReceiveParameters
|
||||||
@ -28,6 +29,7 @@ private const val TAG = "PushHandler"
|
|||||||
|
|
||||||
class PushReceiver @Inject constructor(@ApplicationContext val context: Context) {
|
class PushReceiver @Inject constructor(@ApplicationContext val context: Context) {
|
||||||
private val sodium = LazySodiumAndroid(SodiumAndroid())
|
private val sodium = LazySodiumAndroid(SodiumAndroid())
|
||||||
|
private val json = Json { ignoreUnknownKeys = true }
|
||||||
|
|
||||||
fun onPush(dataMap: Map<String, String>?) {
|
fun onPush(dataMap: Map<String, String>?) {
|
||||||
onPush(dataMap?.asByteArray())
|
onPush(dataMap?.asByteArray())
|
||||||
@ -89,7 +91,7 @@ class PushReceiver @Inject constructor(@ApplicationContext val context: Context)
|
|||||||
?: error("Failed to decode bencoded list from payload")
|
?: error("Failed to decode bencoded list from payload")
|
||||||
|
|
||||||
val metadataJson = (expectedList[0] as? BencodeString)?.value ?: error("no metadata")
|
val metadataJson = (expectedList[0] as? BencodeString)?.value ?: error("no metadata")
|
||||||
val metadata: PushNotificationMetadata = Json.decodeFromString(String(metadataJson))
|
val metadata: PushNotificationMetadata = json.decodeFromString(String(metadataJson))
|
||||||
|
|
||||||
return (expectedList.getOrNull(1) as? BencodeString)?.value.also {
|
return (expectedList.getOrNull(1) as? BencodeString)?.value.also {
|
||||||
// null content is valid only if we got a "data_too_long" flag
|
// null content is valid only if we got a "data_too_long" flag
|
||||||
|
@ -36,15 +36,6 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"/>
|
android:layout_height="wrap_content"/>
|
||||||
|
|
||||||
<include layout="@layout/view_voice_message"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:id="@+id/voiceMessageView"
|
|
||||||
android:layout_width="160dp"
|
|
||||||
android:layout_height="36dp"/>
|
|
||||||
|
|
||||||
<include layout="@layout/view_open_group_invitation"
|
<include layout="@layout/view_open_group_invitation"
|
||||||
tools:visibility="gone"
|
tools:visibility="gone"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
@ -75,6 +66,15 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"/>
|
android:layout_height="wrap_content"/>
|
||||||
|
|
||||||
|
<include layout="@layout/view_voice_message"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/quoteView"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:id="@+id/voiceMessageView"
|
||||||
|
android:layout_width="160dp"
|
||||||
|
android:layout_height="36dp"/>
|
||||||
|
|
||||||
<include layout="@layout/view_link_preview"
|
<include layout="@layout/view_link_preview"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/quoteView"
|
app:layout_constraintTop_toBottomOf="@+id/quoteView"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
Loading…
Reference in New Issue
Block a user