|
|
|
@ -6,7 +6,15 @@ import org.session.libsession.messaging.MessagingModuleConfiguration
|
|
|
|
|
import org.session.libsession.messaging.jobs.BackgroundGroupAddJob
|
|
|
|
|
import org.session.libsession.messaging.jobs.JobQueue
|
|
|
|
|
import org.session.libsession.messaging.messages.Message
|
|
|
|
|
import org.session.libsession.messaging.messages.control.*
|
|
|
|
|
import org.session.libsession.messaging.messages.control.CallMessage
|
|
|
|
|
import org.session.libsession.messaging.messages.control.ClosedGroupControlMessage
|
|
|
|
|
import org.session.libsession.messaging.messages.control.ConfigurationMessage
|
|
|
|
|
import org.session.libsession.messaging.messages.control.DataExtractionNotification
|
|
|
|
|
import org.session.libsession.messaging.messages.control.ExpirationTimerUpdate
|
|
|
|
|
import org.session.libsession.messaging.messages.control.MessageRequestResponse
|
|
|
|
|
import org.session.libsession.messaging.messages.control.ReadReceipt
|
|
|
|
|
import org.session.libsession.messaging.messages.control.TypingIndicator
|
|
|
|
|
import org.session.libsession.messaging.messages.control.UnsendRequest
|
|
|
|
|
import org.session.libsession.messaging.messages.visible.Attachment
|
|
|
|
|
import org.session.libsession.messaging.messages.visible.Reaction
|
|
|
|
|
import org.session.libsession.messaging.messages.visible.VisibleMessage
|
|
|
|
@ -21,18 +29,26 @@ import org.session.libsession.messaging.utilities.SessionId
|
|
|
|
|
import org.session.libsession.messaging.utilities.SodiumUtilities
|
|
|
|
|
import org.session.libsession.messaging.utilities.WebRtcUtils
|
|
|
|
|
import org.session.libsession.snode.SnodeAPI
|
|
|
|
|
import org.session.libsession.utilities.*
|
|
|
|
|
import org.session.libsession.utilities.Address
|
|
|
|
|
import org.session.libsession.utilities.GroupRecord
|
|
|
|
|
import org.session.libsession.utilities.GroupUtil
|
|
|
|
|
import org.session.libsession.utilities.ProfileKeyUtil
|
|
|
|
|
import org.session.libsession.utilities.SSKEnvironment
|
|
|
|
|
import org.session.libsession.utilities.TextSecurePreferences
|
|
|
|
|
import org.session.libsession.utilities.recipients.Recipient
|
|
|
|
|
import org.session.libsignal.crypto.ecc.DjbECPrivateKey
|
|
|
|
|
import org.session.libsignal.crypto.ecc.DjbECPublicKey
|
|
|
|
|
import org.session.libsignal.crypto.ecc.ECKeyPair
|
|
|
|
|
import org.session.libsignal.messages.SignalServiceGroup
|
|
|
|
|
import org.session.libsignal.protos.SignalServiceProtos
|
|
|
|
|
import org.session.libsignal.utilities.*
|
|
|
|
|
import org.session.libsignal.utilities.Base64
|
|
|
|
|
import org.session.libsignal.utilities.IdPrefix
|
|
|
|
|
import org.session.libsignal.utilities.Log
|
|
|
|
|
import org.session.libsignal.utilities.guava.Optional
|
|
|
|
|
import org.session.libsignal.utilities.removingIdPrefixIfNeeded
|
|
|
|
|
import org.session.libsignal.utilities.toHexString
|
|
|
|
|
import java.security.MessageDigest
|
|
|
|
|
import java.util.*
|
|
|
|
|
import java.util.LinkedList
|
|
|
|
|
import kotlin.math.min
|
|
|
|
|
|
|
|
|
|
internal fun MessageReceiver.isBlocked(publicKey: String): Boolean {
|
|
|
|
@ -407,7 +423,7 @@ private fun MessageReceiver.handleClosedGroupControlMessage(message: ClosedGroup
|
|
|
|
|
private fun MessageReceiver.handleNewClosedGroup(message: ClosedGroupControlMessage) {
|
|
|
|
|
val kind = message.kind!! as? ClosedGroupControlMessage.Kind.New ?: return
|
|
|
|
|
val recipient = Recipient.from(MessagingModuleConfiguration.shared.context, Address.fromSerialized(message.sender!!), false)
|
|
|
|
|
if (!recipient.isApproved) return
|
|
|
|
|
if (!recipient.isApproved && !recipient.isLocalNumber) return
|
|
|
|
|
val groupPublicKey = kind.publicKey.toByteArray().toHexString()
|
|
|
|
|
val members = kind.members.map { it.toByteArray().toHexString() }
|
|
|
|
|
val admins = kind.admins.map { it.toByteArray().toHexString() }
|
|
|
|
|