mirror of
https://github.com/lux-tel/session-desktop.git
synced 2026-10-30 20:33:24 +00:00
28 lines
898 B
TypeScript
28 lines
898 B
TypeScript
import { ContentMessageNoProfile } from '../..';
|
|
import { SignalService } from '../../../../../protobuf';
|
|
import { MessageParams } from '../../Message';
|
|
|
|
type ReadReceiptMessageParams = MessageParams & {
|
|
timestamps: Array<number>;
|
|
};
|
|
|
|
export class ReadReceiptMessage extends ContentMessageNoProfile {
|
|
public readonly timestamps: Array<number>;
|
|
|
|
constructor({ createAtNetworkTimestamp, identifier, timestamps }: ReadReceiptMessageParams) {
|
|
super({ createAtNetworkTimestamp, identifier });
|
|
this.timestamps = timestamps;
|
|
}
|
|
|
|
public override contentProto(): SignalService.Content {
|
|
// Note: read receipts are not disappearing messages
|
|
const content = super.makeNonDisappearingContentProto();
|
|
|
|
content.receiptMessage = new SignalService.ReceiptMessage({
|
|
type: SignalService.ReceiptMessage.Type.READ,
|
|
timestamp: this.timestamps,
|
|
});
|
|
return content;
|
|
}
|
|
}
|