mirror of
https://github.com/oxen-io/session-android.git
synced 2023-12-14 02:53:01 +01:00
fix: compile issues
This commit is contained in:
parent
9e183f6e54
commit
06b879057f
4 changed files with 33 additions and 5 deletions
|
@ -46,7 +46,9 @@ class ClosedGroupViewTests {
|
|||
}
|
||||
val overriddenStorage = Storage(applicationContext, mock(), ConfigFactory(context, emptyDb) {
|
||||
keyPair.secretKey to userSessionId.hexString()
|
||||
}, mock())
|
||||
}, mock(), { stringRes, toastLength, parameters ->
|
||||
|
||||
})
|
||||
storage = overriddenStorage
|
||||
}
|
||||
|
||||
|
|
|
@ -1145,6 +1145,11 @@ open class Storage(
|
|||
mmsDB.markAsSent(infoMessageID, true)
|
||||
}
|
||||
|
||||
// override fun insertGroupUpdatedControlMessage(groupSessionId: SessionId,
|
||||
// controlMessage) {
|
||||
//
|
||||
// }
|
||||
|
||||
override fun isLegacyClosedGroup(publicKey: String): Boolean {
|
||||
return DatabaseComponent.get(context).lokiAPIDatabase().isClosedGroup(publicKey)
|
||||
}
|
||||
|
|
|
@ -552,15 +552,13 @@ private fun handleGroupInfoChange(message: GroupUpdated, closedGroup: SessionId)
|
|||
verifyAdminSignature(closedGroup, adminSignature.toByteArray(), "INFO_CHANGE"+type+message.sentTimestamp!!)
|
||||
val newName = if (infoChanged.hasUpdatedName()) infoChanged.updatedName else null
|
||||
val newExpiration = if (infoChanged.hasUpdatedExpiration()) infoChanged.updatedExpiration else null
|
||||
// insert control messages
|
||||
// storage.insertIncomingInfoMessage()
|
||||
}
|
||||
|
||||
private fun handlePromotionMessage(message: GroupUpdated) {
|
||||
val sender = message.sender!!
|
||||
val storage = MessagingModuleConfiguration.shared.storage
|
||||
val inner = message.inner
|
||||
// insert control messages
|
||||
|
||||
}
|
||||
|
||||
private fun MessageReceiver.handleInviteResponse(message: GroupUpdated, closedGroup: SessionId) {
|
||||
|
|
|
@ -3,10 +3,11 @@ package org.session.libsession.messaging.utilities
|
|||
import com.fasterxml.jackson.annotation.JsonSubTypes
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo
|
||||
import com.fasterxml.jackson.core.JsonParseException
|
||||
import org.session.libsession.messaging.messages.control.GroupUpdated
|
||||
import org.session.libsignal.messages.SignalServiceGroup
|
||||
import org.session.libsignal.utilities.JsonUtil
|
||||
import org.session.libsignal.utilities.Log
|
||||
import java.util.*
|
||||
import java.util.Collections
|
||||
|
||||
// class used to save update messages details
|
||||
class UpdateMessageData () {
|
||||
|
@ -35,11 +36,20 @@ class UpdateMessageData () {
|
|||
constructor(): this(Collections.emptyList())
|
||||
}
|
||||
class GroupMemberLeft(): Kind()
|
||||
class GroupMemberUpdated(val sessionIds: List<String>, val type: MemberUpdateType?): Kind() {
|
||||
constructor(): this(emptyList(), null)
|
||||
}
|
||||
class OpenGroupInvitation(val groupUrl: String, val groupName: String): Kind() {
|
||||
constructor(): this("", "")
|
||||
}
|
||||
}
|
||||
|
||||
sealed class MemberUpdateType {
|
||||
data object ADDED: MemberUpdateType()
|
||||
data object REMOVED: MemberUpdateType()
|
||||
data object PROMOTED: MemberUpdateType()
|
||||
}
|
||||
|
||||
constructor(kind: Kind): this() {
|
||||
this.kind = kind
|
||||
}
|
||||
|
@ -58,6 +68,19 @@ class UpdateMessageData () {
|
|||
}
|
||||
}
|
||||
|
||||
fun buildGroupUpdate(groupUpdated: GroupUpdated): UpdateMessageData? {
|
||||
val inner = groupUpdated.inner
|
||||
TODO()
|
||||
// return when {
|
||||
// inner.hasMemberChangeMessage() -> {
|
||||
// val memberChange = inner.memberChangeMessage
|
||||
// val type = memberChange.type
|
||||
// memberChange.memberSessionIdsList
|
||||
// }
|
||||
// else -> null
|
||||
// }
|
||||
}
|
||||
|
||||
fun buildOpenGroupInvitation(url: String, name: String): UpdateMessageData {
|
||||
return UpdateMessageData(Kind.OpenGroupInvitation(url, name))
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue