diff --git a/libsession/src/main/java/org/session/libsession/messaging/messages/control/ClosedGroupControlMessage.kt b/libsession/src/main/java/org/session/libsession/messaging/messages/control/ClosedGroupControlMessage.kt index d7e440fe98..4affd25f2f 100644 --- a/libsession/src/main/java/org/session/libsession/messaging/messages/control/ClosedGroupControlMessage.kt +++ b/libsession/src/main/java/org/session/libsession/messaging/messages/control/ClosedGroupControlMessage.kt @@ -35,8 +35,8 @@ class ClosedGroupControlMessage() : ControlMessage() { class NameChange(val name: String) : Kind() class MembersAdded(val members: List) : Kind() class MembersRemoved( val members: List) : Kind() - object MemberLeft : Kind() - object EncryptionKeyPairRequest: Kind() + class MemberLeft : Kind() + class EncryptionKeyPairRequest: Kind() val description: String = run { when(this) { @@ -46,8 +46,8 @@ class ClosedGroupControlMessage() : ControlMessage() { is NameChange -> "nameChange" is MembersAdded -> "membersAdded" is MembersRemoved -> "membersRemoved" - MemberLeft -> "memberLeft" - EncryptionKeyPairRequest -> "encryptionKeyPairRequest" + is MemberLeft -> "memberLeft" + is EncryptionKeyPairRequest -> "encryptionKeyPairRequest" } } } @@ -92,10 +92,10 @@ class ClosedGroupControlMessage() : ControlMessage() { kind = Kind.MembersRemoved(closedGroupControlMessageProto.membersList) } DataMessage.ClosedGroupControlMessage.Type.MEMBER_LEFT -> { - kind = Kind.MemberLeft + kind = Kind.MemberLeft() } DataMessage.ClosedGroupControlMessage.Type.ENCRYPTION_KEY_PAIR_REQUEST -> { - kind = Kind.EncryptionKeyPairRequest + kind = Kind.EncryptionKeyPairRequest() } } return ClosedGroupControlMessage(kind) diff --git a/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/MessageReceiverHandler.kt b/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/MessageReceiverHandler.kt index 530badd329..f12776acf6 100644 --- a/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/MessageReceiverHandler.kt +++ b/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/MessageReceiverHandler.kt @@ -212,8 +212,8 @@ private fun MessageReceiver.handleClosedGroupControlMessage(message: ClosedGroup is ClosedGroupControlMessage.Kind.NameChange -> handleClosedGroupNameChanged(message) is ClosedGroupControlMessage.Kind.MembersAdded -> handleClosedGroupMembersAdded(message) is ClosedGroupControlMessage.Kind.MembersRemoved -> handleClosedGroupMembersRemoved(message) - ClosedGroupControlMessage.Kind.MemberLeft -> handleClosedGroupMemberLeft(message) - ClosedGroupControlMessage.Kind.EncryptionKeyPairRequest -> handleClosedGroupEncryptionKeyPairRequest(message) + is ClosedGroupControlMessage.Kind.MemberLeft -> handleClosedGroupMemberLeft(message) + is ClosedGroupControlMessage.Kind.EncryptionKeyPairRequest -> handleClosedGroupEncryptionKeyPairRequest(message) } } diff --git a/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/MessageSenderClosedGroup.kt b/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/MessageSenderClosedGroup.kt index 05353cd896..473dd1f9ec 100644 --- a/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/MessageSenderClosedGroup.kt +++ b/libsession/src/main/java/org/session/libsession/messaging/sending_receiving/MessageSenderClosedGroup.kt @@ -50,9 +50,11 @@ fun MessageSender.create(name: String, members: Collection): Promise