mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-27 12:05:22 +00:00
Fill in stub
This commit is contained in:
parent
5b641f4415
commit
fdec8eae4b
@ -247,7 +247,8 @@ class EditClosedGroupActivity : PassphraseRequiredActionBarActivity() {
|
|||||||
|
|
||||||
if (isSSKBasedClosedGroup) {
|
if (isSSKBasedClosedGroup) {
|
||||||
//TODO AC: Should it use "groupPublicKey" or "groupID"?
|
//TODO AC: Should it use "groupPublicKey" or "groupID"?
|
||||||
ClosedGroupsProtocol.updateGroup(this, groupPublicKey!!, finalGroupMembers, null, groupDisplayName, finalGroupAdmins)
|
ClosedGroupsProtocol.update(this, groupPublicKey!!, finalGroupMembers.map { it.address.serialize() },
|
||||||
|
groupDisplayName, finalGroupAdmins.map { it.address.serialize() })
|
||||||
} else {
|
} else {
|
||||||
GroupManager.updateGroup(this, groupID, finalGroupMembers, null, groupDisplayName, finalGroupAdmins)
|
GroupManager.updateGroup(this, groupID, finalGroupMembers, null, groupDisplayName, finalGroupAdmins)
|
||||||
}
|
}
|
||||||
|
@ -184,15 +184,23 @@ object ClosedGroupsProtocol {
|
|||||||
insertOutgoingInfoMessage(context, groupID, GroupContext.Type.QUIT, name, members, admins, threadID)
|
insertOutgoingInfoMessage(context, groupID, GroupContext.Type.QUIT, name, members, admins, threadID)
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO AC: This is a reflection of GroupManager's update API.
|
public fun update(context: Context, groupPublicKey: String, members: Collection<String>, name: String, admins: Collection<String>) {
|
||||||
// It needs a valid implementation and probably the signature should be refactored a bit.
|
val groupDB = DatabaseFactory.getGroupDatabase(context)
|
||||||
public fun updateGroup(context: Context,
|
val groupID = doubleEncodeGroupID(groupPublicKey)
|
||||||
groupPublicKey: String,
|
if (groupDB.getGroup(groupID).orNull() == null) {
|
||||||
members: Collection<Recipient>,
|
Log.d("Loki", "Can't update nonexistent closed group.")
|
||||||
avatar: Bitmap?,
|
return
|
||||||
name: String,
|
}
|
||||||
admins: Collection<Recipient>) {
|
// Send the update to the group
|
||||||
// STUB
|
val closedGroupUpdateKind = ClosedGroupUpdateMessageSendJob.Kind.Info(Hex.fromStringCondensed(groupPublicKey),
|
||||||
|
name, setOf(), members.map { Hex.fromStringCondensed(it) }, admins.map { Hex.fromStringCondensed(it) })
|
||||||
|
val job = ClosedGroupUpdateMessageSendJob(groupPublicKey, closedGroupUpdateKind)
|
||||||
|
ApplicationContext.getInstance(context).jobManager.add(job)
|
||||||
|
// Update the group
|
||||||
|
groupDB.updateMembers(groupID, members.map { Address.fromSerialized(it) })
|
||||||
|
// Notify the user
|
||||||
|
val threadID = DatabaseFactory.getThreadDatabase(context).getThreadIdFor(Recipient.from(context, Address.fromSerialized(groupID), false))
|
||||||
|
insertOutgoingInfoMessage(context, groupID, GroupContext.Type.UPDATE, name, members, admins, threadID)
|
||||||
}
|
}
|
||||||
|
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
|
Loading…
Reference in New Issue
Block a user