feat: add remove member, edit group metadata, and formatting fixes
- Add removeMember() to MarmotManager and AccountViewModel - Add updateGroupMetadata() to MarmotManager for MIP-01 name/description - Add MarmotGroupData.toExtension() for encoding metadata as MLS extension - Add proposeGroupContextExtensions() to MlsGroup - Apply spotlessApply formatting fixes - SecretTree: prune consumed generations below current minimum https://claude.ai/code/session_018gVkmmYgMFtBH7G31pCk9N
This commit is contained in:
+17
@@ -218,6 +218,23 @@ class MarmotManager(
|
||||
return outboundEvent
|
||||
}
|
||||
|
||||
/**
|
||||
* Update group metadata (name, description, etc.) via a GroupContextExtensions proposal.
|
||||
* Creates a GCE proposal, commits it, and returns the commit event to publish.
|
||||
*/
|
||||
suspend fun updateGroupMetadata(
|
||||
nostrGroupId: HexKey,
|
||||
metadata: MarmotGroupData,
|
||||
): OutboundGroupEvent {
|
||||
val group =
|
||||
groupManager.getGroup(nostrGroupId)
|
||||
?: throw IllegalStateException("Not a member of group $nostrGroupId")
|
||||
group.proposeGroupContextExtensions(listOf(metadata.toExtension()))
|
||||
val commitResult = group.commit()
|
||||
groupManager.saveGroupState(nostrGroupId)
|
||||
return outboundProcessor.buildCommitEvent(nostrGroupId, commitResult.commitBytes)
|
||||
}
|
||||
|
||||
// --- KeyPackage Management ---
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user