|
|
|
@ -5,6 +5,7 @@ import { GroupUpdateMessage, GroupUpdateMessageParams } from '../GroupUpdateMess
|
|
|
|
|
interface Params extends GroupUpdateMessageParams {
|
|
|
|
|
groupPk: GroupPubkeyType;
|
|
|
|
|
groupIdentitySeed: Uint8Array;
|
|
|
|
|
name: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -12,19 +13,25 @@ interface Params extends GroupUpdateMessageParams {
|
|
|
|
|
*/
|
|
|
|
|
export class GroupUpdatePromoteMessage extends GroupUpdateMessage {
|
|
|
|
|
public readonly groupIdentitySeed: Params['groupIdentitySeed'];
|
|
|
|
|
public readonly name: Params['name'];
|
|
|
|
|
|
|
|
|
|
constructor(params: Params) {
|
|
|
|
|
super(params);
|
|
|
|
|
|
|
|
|
|
this.groupIdentitySeed = params.groupIdentitySeed;
|
|
|
|
|
this.name = params.name;
|
|
|
|
|
if (!this.groupIdentitySeed || this.groupIdentitySeed.length !== 32) {
|
|
|
|
|
throw new Error('groupIdentitySeed must be set');
|
|
|
|
|
}
|
|
|
|
|
if (!this.name) {
|
|
|
|
|
throw new Error('name must be set and not empty');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public dataProto(): SignalService.DataMessage {
|
|
|
|
|
const promoteMessage = new SignalService.GroupUpdatePromoteMessage({
|
|
|
|
|
groupIdentitySeed: this.groupIdentitySeed,
|
|
|
|
|
name: this.name,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return new SignalService.DataMessage({
|
|
|
|
|