code saving

This commit is contained in:
2021-09-21 13:39:34 +03:00
parent d1ed98691c
commit 56fb93d2e4
43 changed files with 665 additions and 122 deletions
@@ -27,7 +27,9 @@ object VkUtils {
return throwable.error == VkErrors.NEED_CAPTCHA
}
fun prepareMessageText(text: String): String {
fun prepareMessageText(text: String?): String? {
if (text == null) return null
return text
.replace("\n", " ")
.replace("&amp", "&")
@@ -58,9 +60,7 @@ object VkUtils {
}
BaseVkAttachmentItem.AttachmentType.VIDEO -> {
val video = baseAttachment.video ?: continue
attachments += VkVideo(
link = video.player
)
attachments += video.asVkVideo()
}
BaseVkAttachmentItem.AttachmentType.AUDIO -> {
val audio = baseAttachment.audio ?: continue