Fixed an issue introduced by the last commit with OpenGroup initialisation

This commit is contained in:
Morgan Pretty 2023-01-10 13:02:25 +11:00
parent 5afd647686
commit 3e68bdc2f8
2 changed files with 2 additions and 2 deletions

View File

@ -81,7 +81,7 @@ object OpenGroupManager {
if (threadID < 0) {
threadID = GroupManager.createOpenGroup(openGroupID, context, null, info.name).threadId
}
val openGroup = OpenGroup(server, room, publicKey, info.name, info.imageId, info.infoUpdates)
val openGroup = OpenGroup(server = server, room = room, publicKey = publicKey, name = info.name, imageId = info.imageId, infoUpdates = info.infoUpdates)
threadDB.setOpenGroupChat(openGroup, threadID)
return info
}

View File

@ -38,7 +38,7 @@ data class OpenGroup(
val imageId = json.get("imageId")?.asText()
val infoUpdates = json.get("infoUpdates")?.asText()?.toIntOrNull() ?: 0
val capabilities = json.get("capabilities")?.asText()?.split(",") ?: emptyList()
OpenGroup(server, room, displayName, publicKey, imageId, infoUpdates)
OpenGroup(server = server, room = room, name = displayName, publicKey = publicKey, imageId = imageId, infoUpdates = infoUpdates)
} catch (e: Exception) {
Log.w("Loki", "Couldn't parse open group from JSON: $jsonAsString.", e);
null