mirror of
https://github.com/Blah-IM/blahrs.git
synced 2025-07-04 13:25:33 +00:00
remove(types)!: remove members
from CreateGroup
Now a group can only be created with the creator as the only initial member. This forbids group creator from adding other members without their consent. Additional members can join the group later at their own will.
This commit is contained in:
parent
93d779b615
commit
985ea1d68a
5 changed files with 27 additions and 75 deletions
|
@ -4,8 +4,8 @@ use std::{fs, io};
|
|||
|
||||
use anyhow::{Context, Result};
|
||||
use blah_types::{
|
||||
bitflags, get_timestamp, ChatPayload, CreateGroup, CreateRoomPayload, Id, MemberPermission,
|
||||
RichText, RoomAttrs, RoomMember, RoomMemberList, ServerPermission, Signed, UserKey,
|
||||
bitflags, get_timestamp, ChatPayload, CreateGroup, CreateRoomPayload, Id, RichText, RoomAttrs,
|
||||
ServerPermission, Signed, UserKey,
|
||||
};
|
||||
use ed25519_dalek::pkcs8::spki::der::pem::LineEnding;
|
||||
use ed25519_dalek::pkcs8::{DecodePrivateKey, DecodePublicKey, EncodePrivateKey, EncodePublicKey};
|
||||
|
@ -220,12 +220,6 @@ async fn main_api(api_url: Url, command: ApiCommand) -> Result<()> {
|
|||
let payload = CreateRoomPayload::Group(CreateGroup {
|
||||
attrs: attrs.unwrap_or_default(),
|
||||
title,
|
||||
// The CLI does not support passing multiple members because `User` itself is a
|
||||
// disjoint arg-group.
|
||||
members: RoomMemberList(vec![RoomMember {
|
||||
permission: MemberPermission::ALL,
|
||||
user: UserKey(key.verifying_key().to_bytes()),
|
||||
}]),
|
||||
});
|
||||
let payload = Signed::sign(&key, get_timestamp(), &mut OsRng, payload)?;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue