yayan 1 سال پیش
والد
کامیت
be9af7bbd6

+ 0 - 9
app/src/main/java/io/nexilis/alpha/ui/components/Attachments.kt

@@ -338,12 +338,6 @@ fun AttachmentCaption(
     pin: String,
     attachments: AttachmentItemList
 ) {
-    val al = arrayListOf<Uri>()
-    attachments.list.forEach {
-        it?.let {
-            al.add(it.uri)
-        }
-    }
     var textInput by rememberSaveable(stateSaver = TextFieldValue.Saver) {
         mutableStateOf(TextFieldValue("", TextRange(0, 7)))
     }
@@ -382,9 +376,6 @@ fun AttachmentCaption(
             trailingIcon = {
                 Row {
                     IconButton(onClick = {
-                        if (textInput.text.trim().isEmpty()) {
-                            return@IconButton
-                        }
                         val me = context.getSharedPreferences().getString("pin", null)
                         me?.let {
                             attachments.list[0]?.let { item ->

+ 3 - 1
app/src/main/java/io/nexilis/alpha/ui/components/ContentChat.kt

@@ -1,5 +1,6 @@
 package io.nexilis.alpha.ui.components
 
+import android.util.Log
 import androidx.compose.foundation.Image
 import androidx.compose.foundation.background
 import androidx.compose.foundation.layout.Column
@@ -32,13 +33,14 @@ import io.nexilis.alpha.BuildConfig
 import io.nexilis.service.core.DarkLimeGreen
 import io.nexilis.service.core.Orange
 import io.nexilis.service.data.entities.Message
+import java.io.File
 
 @Composable
 fun ContentChat(message: Message) {
     val context = LocalContext.current
     if (message.image_id.isNotEmpty()) {
         Column(modifier = Modifier.padding(2.dp)) {
-            val file = context.getFileStreamPath(message.image_id)
+            val file = File(context.filesDir, message.image_id)
             val uri = FileProvider.getUriForFile(
                 context, BuildConfig.APPLICATION_ID + ".provider", file
             )

+ 1 - 1
cpaas-lite/src/main/java/io/nexilis/service/core/Extension.kt

@@ -52,7 +52,7 @@ fun Context.createImageFile(): File {
     val imageFileName = "IMG_" + timeStamp + "_"
     return File.createTempFile(
         imageFileName,
-        ".webp",
+        ".jpeg",
         filesDir
     )
 }

+ 1 - 1
cpaas-lite/src/main/java/io/nexilis/service/core/Outgoing.kt

@@ -34,7 +34,7 @@ class Outgoing(private val context: Context, parameters: WorkerParameters) :
                         "lcltm" to message.local_timestamp.toString(),
                         "A06" to message.message_scope_id,
                         "A15" to message.status,
-                        "A07" to message.message_text.toStupidString(),
+                        "A07" to message.message_text.trim().toStupidString(),
                         "A118" to message.credential,
                         "A149" to message.attachment_flag.toString(),
                         "A52" to message.blog_id,

+ 57 - 55
cpaas-lite/src/main/java/io/nexilis/service/data/entities/Message.kt

@@ -123,59 +123,61 @@ data class Message(
         call_center: Int = 0,
         call_center_id: String = "",
         work_mode: Int = 0
-    ) : this("",
-        "",
-        "",
-        "",
-        0,
-        "",
-        "",
-        "",
-        "",
-        "",
-        "",
-        "",
-        "",
-        "",
-        0,
-        "",
-        "",
-        "",
-        0,
-        "",
-        "",
-        0,
-        "",
-        "",
-        "",
-        0,
-        0,
-        "",
-        "",
-        0,
-        0,
-        0,
-        0,
-        0,
-        "",
-        "",
-        "",
-        "",
-        "",
-        "",
-        "",
-        "",
-        0,
-        0,
-        "",
-        "",
-        0,
-        "",
-        "",
-        0,
-        0,
-        0,
-        "",
-        0,
-        Uri.EMPTY)
+    ) : this(
+        message_id,
+        f_pin,
+        l_pin,
+        message_scope_id,
+        server_date,
+        status,
+        message_text,
+        audio_id,
+        video_id,
+        image_id,
+        thumb_id,
+        opposite_pin,
+        lock,
+        format,
+        broadcast_flag,
+        blog_id,
+        f_user_id,
+        l_user_id,
+        read_receipts,
+        chat_id,
+        file_id,
+        delivery_receipts,
+        account_type,
+        contact,
+        credential,
+        attachment_flag,
+        stared,
+        f_display_name,
+        reff_id,
+        sent_qty,
+        delivered_qty,
+        read_qty,
+        ack_qty,
+        read_local_qty,
+        delivered_pin,
+        read_pin,
+        ack_pin,
+        read_local_pin,
+        expired_qty,
+        message_large_text,
+        tag_forum,
+        tag_activity,
+        unk_numbers,
+        conn_state,
+        tag_client,
+        tag_subactivity,
+        messagenumber,
+        mail_account,
+        message_text_plain,
+        local_timestamp,
+        consult,
+        call_center,
+        call_center_id,
+        work_mode,
+        Uri.EMPTY
+    )
 }