Skip to content

Commit 6daee20

Browse files
committed
Removing attachments preview to open a dedicated PR
1 parent 9871cd8 commit 6daee20

File tree

9 files changed

+51
-422
lines changed

9 files changed

+51
-422
lines changed

WordPress/src/main/java/org/wordpress/android/support/he/model/SupportMessage.kt

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,4 @@ data class SupportMessage(
1212
val createdAt: Date,
1313
val authorName: String,
1414
val authorIsUser: Boolean,
15-
val attachments: List<SupportAttachment>,
1615
)
17-
18-
data class SupportAttachment (
19-
val id: Long,
20-
val filename: String,
21-
val url: String,
22-
val type: AttachmentType,
23-
)
24-
25-
enum class AttachmentType { Image, Video, Other }

WordPress/src/main/java/org/wordpress/android/support/he/repository/HESupportRepository.kt

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import kotlinx.coroutines.withContext
55
import org.wordpress.android.fluxc.utils.AppLogWrapper
66
import org.wordpress.android.modules.IO_THREAD
77
import org.wordpress.android.networking.restapi.WpComApiClientProvider
8-
import org.wordpress.android.support.he.model.AttachmentType
9-
import org.wordpress.android.support.he.model.SupportAttachment
108
import org.wordpress.android.support.he.model.SupportConversation
119
import org.wordpress.android.support.he.model.SupportMessage
1210
import org.wordpress.android.ui.compose.utils.markdownToAnnotatedString
@@ -205,22 +203,5 @@ class HESupportRepository @Inject constructor(
205203
is SupportMessageAuthor.SupportAgent -> (author as SupportMessageAuthor.SupportAgent).v1.name
206204
},
207205
authorIsUser = authorIsCurrentUser,
208-
attachments = attachments.map { it.toSupportAttachment() }
209206
)
210-
211-
private fun uniffi.wp_api.SupportAttachment.toSupportAttachment(): SupportAttachment =
212-
SupportAttachment(
213-
id = id.toLong(),
214-
filename = filename,
215-
url = url,
216-
type = determineAttachmentType(contentType)
217-
)
218-
219-
private fun determineAttachmentType(contentType: String): AttachmentType {
220-
return when {
221-
contentType.startsWith("image/") -> AttachmentType.Image
222-
contentType.startsWith("video/") -> AttachmentType.Video
223-
else -> AttachmentType.Other
224-
}
225-
}
226207
}

WordPress/src/main/java/org/wordpress/android/support/he/ui/AttachmentFullscreenImagePreview.kt

Lines changed: 0 additions & 193 deletions
This file was deleted.

0 commit comments

Comments
 (0)