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.
36 lines
997 B
TypeScript
36 lines
997 B
TypeScript
4 years ago
|
import { SignalService } from '../../../../protobuf';
|
||
1 year ago
|
import { DataMessage } from '../DataMessage';
|
||
|
import { ExpirableMessageParams } from '../ExpirableMessage';
|
||
5 years ago
|
|
||
4 months ago
|
interface CommunityInvitationMessageParams extends ExpirableMessageParams {
|
||
4 years ago
|
url: string;
|
||
|
name: string;
|
||
5 years ago
|
}
|
||
|
|
||
4 months ago
|
export class CommunityInvitationMessage extends DataMessage {
|
||
4 years ago
|
private readonly url: string;
|
||
|
private readonly name: string;
|
||
5 years ago
|
|
||
4 months ago
|
constructor(params: CommunityInvitationMessageParams) {
|
||
2 years ago
|
super({
|
||
|
createAtNetworkTimestamp: params.createAtNetworkTimestamp,
|
||
|
identifier: params.identifier,
|
||
2 years ago
|
expirationType: params.expirationType,
|
||
|
expireTimer: params.expireTimer,
|
||
2 years ago
|
});
|
||
4 years ago
|
this.url = params.url;
|
||
|
this.name = params.name;
|
||
5 years ago
|
}
|
||
5 years ago
|
|
||
5 years ago
|
public dataProto(): SignalService.DataMessage {
|
||
4 years ago
|
const openGroupInvitation = new SignalService.DataMessage.OpenGroupInvitation({
|
||
4 years ago
|
url: this.url,
|
||
|
name: this.name,
|
||
5 years ago
|
});
|
||
|
|
||
|
return new SignalService.DataMessage({
|
||
4 years ago
|
openGroupInvitation,
|
||
5 years ago
|
});
|
||
5 years ago
|
}
|
||
|
}
|