mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-25 01:07:47 +00:00
Debug message sending
This commit is contained in:
parent
8e14c7abb6
commit
80bbeee7ce
@ -124,7 +124,8 @@ class CreateClosedGroupActivity : PassphraseRequiredActionBarActivity(), MemberC
|
|||||||
if (selectedMembers.count() > 49) { // Minus one because we're going to include self later
|
if (selectedMembers.count() > 49) { // Minus one because we're going to include self later
|
||||||
return Toast.makeText(this, R.string.activity_create_closed_group_too_many_group_members_error, Toast.LENGTH_LONG).show()
|
return Toast.makeText(this, R.string.activity_create_closed_group_too_many_group_members_error, Toast.LENGTH_LONG).show()
|
||||||
}
|
}
|
||||||
ClosedGroupsProtocol.createClosedGroup(this, name.toString(), selectedMembers)
|
val userPublicKey = TextSecurePreferences.getLocalNumber(this)
|
||||||
|
ClosedGroupsProtocol.createClosedGroup(this, name.toString(), selectedMembers + setOf( userPublicKey ))
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun createLegacyClosedGroup() {
|
private fun createLegacyClosedGroup() {
|
||||||
|
@ -6,7 +6,9 @@ import nl.komponents.kovenant.Promise
|
|||||||
import org.thoughtcrime.securesms.ApplicationContext
|
import org.thoughtcrime.securesms.ApplicationContext
|
||||||
import org.thoughtcrime.securesms.database.Address
|
import org.thoughtcrime.securesms.database.Address
|
||||||
import org.thoughtcrime.securesms.database.DatabaseFactory
|
import org.thoughtcrime.securesms.database.DatabaseFactory
|
||||||
|
import org.thoughtcrime.securesms.database.ThreadDatabase
|
||||||
import org.thoughtcrime.securesms.loki.utilities.recipient
|
import org.thoughtcrime.securesms.loki.utilities.recipient
|
||||||
|
import org.thoughtcrime.securesms.mms.OutgoingMediaMessage
|
||||||
import org.thoughtcrime.securesms.recipients.Recipient
|
import org.thoughtcrime.securesms.recipients.Recipient
|
||||||
import org.thoughtcrime.securesms.sms.MessageSender
|
import org.thoughtcrime.securesms.sms.MessageSender
|
||||||
import org.thoughtcrime.securesms.util.GroupUtil
|
import org.thoughtcrime.securesms.util.GroupUtil
|
||||||
@ -57,7 +59,9 @@ object ClosedGroupsProtocol {
|
|||||||
// Add the group to the user's set of public keys to poll for
|
// Add the group to the user's set of public keys to poll for
|
||||||
DatabaseFactory.getSSKDatabase(context).setClosedGroupPrivateKey(groupPublicKey, groupKeyPair.hexEncodedPrivateKey)
|
DatabaseFactory.getSSKDatabase(context).setClosedGroupPrivateKey(groupPublicKey, groupKeyPair.hexEncodedPrivateKey)
|
||||||
// Notify the user
|
// Notify the user
|
||||||
// TODO: Implement
|
val infoMessage = OutgoingMediaMessage(Recipient.from(context, Address.fromSerialized(groupID), false), "Test", listOf(), System.currentTimeMillis(),
|
||||||
|
0, 0, ThreadDatabase.DistributionTypes.CONVERSATION, null, listOf(), listOf(), listOf(), listOf())
|
||||||
|
MessageSender.send(context, infoMessage, -1, false, null)
|
||||||
// Return
|
// Return
|
||||||
return Promise.of(Unit)
|
return Promise.of(Unit)
|
||||||
}
|
}
|
||||||
@ -349,8 +353,12 @@ object ClosedGroupsProtocol {
|
|||||||
if (GroupUtil.isOpenGroup(groupID)) {
|
if (GroupUtil.isOpenGroup(groupID)) {
|
||||||
return listOf( Address.fromSerialized(groupID) )
|
return listOf( Address.fromSerialized(groupID) )
|
||||||
} else {
|
} else {
|
||||||
// TODO: Shared sender keys
|
val groupPublicKey = GroupUtil.getDecodedId(groupID).toHexString()
|
||||||
|
if (DatabaseFactory.getSSKDatabase(context).isSSKBasedClosedGroup(groupPublicKey)) {
|
||||||
|
return listOf( Address.fromSerialized(groupPublicKey) )
|
||||||
|
} else {
|
||||||
return DatabaseFactory.getGroupDatabase(context).getGroupMembers(groupID, false).map { it.address }
|
return DatabaseFactory.getGroupDatabase(context).getGroupMembers(groupID, false).map { it.address }
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
return FileServerAPI.shared.getDeviceLinks(members.map { it.address.serialize() }.toSet()).map {
|
return FileServerAPI.shared.getDeviceLinks(members.map { it.address.serialize() }.toSet()).map {
|
||||||
val result = members.flatMap { member ->
|
val result = members.flatMap { member ->
|
||||||
|
Loading…
x
Reference in New Issue
Block a user