fix open group message

This commit is contained in:
Ryan ZHAO 2021-01-08 11:11:23 +11:00
parent 91ef23081b
commit ed8eb5a239
2 changed files with 3 additions and 3 deletions

View File

@ -143,7 +143,7 @@ object OpenGroupAPI: DotNetAPI() {
val dateAsString = message["created_at"] as String val dateAsString = message["created_at"] as String
val serverTimestamp = format.parse(dateAsString).time val serverTimestamp = format.parse(dateAsString).time
// Verify the message // Verify the message
val groupMessage = OpenGroupMessage(serverID, publicKey, displayName, body, timestamp, openGroupMessageType, quote, attachments, profilePicture, signature, serverTimestamp) val groupMessage = OpenGroupMessage(serverID, publicKey, displayName, body, timestamp, openGroupMessageType, quote, attachments.toMutableList(), profilePicture, signature, serverTimestamp)
if (groupMessage.hasValidSignature()) groupMessage else null if (groupMessage.hasValidSignature()) groupMessage else null
} catch (exception: Exception) { } catch (exception: Exception) {
Log.d("Loki", "Couldn't parse message for open group with ID: $channel on server: $server from: ${JsonUtil.toJson(message)}. Exception: ${exception.message}") Log.d("Loki", "Couldn't parse message for open group with ID: $channel on server: $server from: ${JsonUtil.toJson(message)}. Exception: ${exception.message}")

View File

@ -56,7 +56,7 @@ public data class OpenGroupMessage(
Attachment.Kind.LinkPreview, Attachment.Kind.LinkPreview,
server, server,
attachment.id, attachment.id,
attachment.contentType, attachment.contentType!!,
attachment.size.get(), attachment.size.get(),
attachment.fileName.get(), attachment.fileName.get(),
0, 0,
@ -75,7 +75,7 @@ public data class OpenGroupMessage(
Attachment.Kind.Attachment, Attachment.Kind.Attachment,
server, server,
attachment.id, attachment.id,
attachment.contentType, attachment.contentType!!,
attachment.size.get(), attachment.size.get(),
attachment.fileName.get(), attachment.fileName.get(),
0, 0,