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.
session-desktop/ts/session/messages/outgoing/controlMessage/UnsendMessage.ts

31 lines
830 B
TypeScript

import { SignalService } from '../../../../protobuf';
import { ContentMessage } from '../ContentMessage';
import { MessageParams } from '../Message';
interface UnsendMessageParams extends MessageParams {
author: string;
}
export class UnsendMessage extends ContentMessage {
private readonly author: string;
constructor(params: UnsendMessageParams) {
super({
createAtNetworkTimestamp: params.createAtNetworkTimestamp,
author: params.author,
} as MessageParams);
this.author = params.author;
}
public contentProto(): SignalService.Content {
return super.makeContentProto({ unsendMessage: this.unsendProto() });
}
public unsendProto(): SignalService.Unsend {
return new SignalService.Unsend({
timestamp: this.createAtNetworkTimestamp,
author: this.author,
});
}
}