You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.2 KiB
TypeScript
40 lines
1.2 KiB
TypeScript
// this is not a very good name, but a configuration message is a message sent to our other devices so sync our current public and closed groups
|
|
|
|
import { SignalService } from '../../../../protobuf';
|
|
import { MessageParams } from '../Message';
|
|
import { ContentMessage } from '..';
|
|
import Long from 'long';
|
|
|
|
interface SharedConfigParams extends MessageParams {
|
|
seqno: Long;
|
|
kind: SignalService.SharedConfigMessage.Kind;
|
|
data: Uint8Array;
|
|
}
|
|
|
|
export class SharedConfigMessage extends ContentMessage {
|
|
public readonly seqno: Long;
|
|
public readonly kind: SignalService.SharedConfigMessage.Kind;
|
|
public readonly data: Uint8Array;
|
|
|
|
constructor(params: SharedConfigParams) {
|
|
super({ timestamp: params.timestamp, identifier: params.identifier });
|
|
this.data = params.data;
|
|
this.kind = params.kind;
|
|
this.seqno = params.seqno;
|
|
}
|
|
|
|
public contentProto(): SignalService.Content {
|
|
return new SignalService.Content({
|
|
sharedConfigMessage: this.sharedConfigProto(),
|
|
});
|
|
}
|
|
|
|
protected sharedConfigProto(): SignalService.SharedConfigMessage {
|
|
return new SignalService.SharedConfigMessage({
|
|
data: this.data,
|
|
kind: this.kind,
|
|
seqno: this.seqno,
|
|
});
|
|
}
|
|
}
|