include expireTimer in group invitation message so it does not reset it

pull/1381/head
Audric Ackermann 4 years ago
parent 9e52a7a780
commit 545eef4edb
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -1285,6 +1285,7 @@
serverName: groupInvitation.name, serverName: groupInvitation.name,
channelId: groupInvitation.channelId, channelId: groupInvitation.channelId,
serverAddress: groupInvitation.address, serverAddress: groupInvitation.address,
expireTimer: this.get('expireTimer'),
} }
); );

@ -7,18 +7,23 @@ interface GroupInvitationMessageParams extends MessageParams {
serverAddress: string; serverAddress: string;
channelId: number; channelId: number;
serverName: string; serverName: string;
// if there is an expire timer set for the conversation, we need to set it.
// otherwise, it will disable the expire timer on the receiving side.
expireTimer?: number;
} }
export class GroupInvitationMessage extends DataMessage { export class GroupInvitationMessage extends DataMessage {
private readonly serverAddress: string; private readonly serverAddress: string;
private readonly channelId: number; private readonly channelId: number;
private readonly serverName: string; private readonly serverName: string;
private readonly expireTimer?: number;
constructor(params: GroupInvitationMessageParams) { constructor(params: GroupInvitationMessageParams) {
super({ timestamp: params.timestamp, identifier: params.identifier }); super({ timestamp: params.timestamp, identifier: params.identifier });
this.serverAddress = params.serverAddress; this.serverAddress = params.serverAddress;
this.channelId = params.channelId; this.channelId = params.channelId;
this.serverName = params.serverName; this.serverName = params.serverName;
this.expireTimer = params.expireTimer;
} }
public ttl(): number { public ttl(): number {
@ -32,8 +37,10 @@ export class GroupInvitationMessage extends DataMessage {
serverName: this.serverName, serverName: this.serverName,
}); });
return new SignalService.DataMessage({ return new SignalService.DataMessage({
groupInvitation, groupInvitation,
expireTimer: this.expireTimer,
}); });
} }
} }

Loading…
Cancel
Save