syntax = "proto3";
package qpq.v1;

// Group management (4 methods).
// Method IDs: 410-413.

// RemoveMember (410): Remove a member from a group.
message RemoveMemberRequest {
  bytes group_id = 1;
  bytes member_identity_key = 2;
}

message RemoveMemberResponse {
  bytes commit = 1;
}

// UpdateGroupMetadata (411): Set group name, description, avatar.
message UpdateGroupMetadataRequest {
  bytes group_id = 1;
  string name = 2;
  string description = 3;
  bytes avatar_hash = 4;
}

message UpdateGroupMetadataResponse {
  bool success = 1;
}

// ListGroupMembers (412): List members of a group.
message ListGroupMembersRequest {
  bytes group_id = 1;
}

message ListGroupMembersResponse {
  repeated GroupMemberInfo members = 1;
}

message GroupMemberInfo {
  bytes identity_key = 1;
  string username = 2;
  uint64 joined_at = 3;
}

// RotateKeys (413): Trigger key rotation (Update proposal + Commit).
message RotateKeysRequest {
  bytes group_id = 1;
}

message RotateKeysResponse {
  bytes commit = 1;
}

// GroupMetadata stored server-side.
message GroupMetadata {
  bytes group_id = 1;
  string name = 2;
  string description = 3;
  bytes avatar_hash = 4;
  bytes creator_key = 5;
  uint64 created_at = 6;
}
