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.
37 lines
1.0 KiB
TypeScript
37 lines
1.0 KiB
TypeScript
import { SignalService } from '../../../../protobuf';
|
|
import { VisibleMessage, VisibleMessageParams } from './VisibleMessage';
|
|
|
|
interface GroupInvitationMessageParams extends VisibleMessageParams {
|
|
url: string;
|
|
name: string;
|
|
}
|
|
|
|
export class GroupInvitationMessage extends VisibleMessage {
|
|
private readonly url: string;
|
|
private readonly name: string;
|
|
|
|
constructor(params: GroupInvitationMessageParams) {
|
|
super({
|
|
timestamp: params.timestamp,
|
|
identifier: params.identifier,
|
|
expirationType: params.expirationType,
|
|
expireTimer: params.expireTimer,
|
|
lastDisappearingMessageChangeTimestamp: params.lastDisappearingMessageChangeTimestamp,
|
|
});
|
|
this.url = params.url;
|
|
this.name = params.name;
|
|
}
|
|
|
|
public dataProto(): SignalService.DataMessage {
|
|
const openGroupInvitation = new SignalService.DataMessage.OpenGroupInvitation({
|
|
url: this.url,
|
|
name: this.name,
|
|
});
|
|
|
|
return new SignalService.DataMessage({
|
|
...super.dataProto(),
|
|
openGroupInvitation,
|
|
});
|
|
}
|
|
}
|