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
932 B
TypeScript
37 lines
932 B
TypeScript
import { Message, MessageParams } from './Message';
|
|
import { AttachmentPointer, Preview, Quote } from './content';
|
|
import { OpenGroup } from '../../types/OpenGroup';
|
|
|
|
interface OpenGroupMessageParams extends MessageParams {
|
|
group: OpenGroup;
|
|
attachments?: Array<AttachmentPointer>;
|
|
preview?: Array<Preview>;
|
|
body?: string;
|
|
quote?: Quote;
|
|
}
|
|
|
|
export class OpenGroupMessage extends Message {
|
|
public readonly group: OpenGroup;
|
|
public readonly body?: string;
|
|
public readonly attachments: Array<AttachmentPointer>;
|
|
public readonly quote?: Quote;
|
|
public readonly preview: Array<Preview>;
|
|
|
|
constructor({
|
|
timestamp,
|
|
group,
|
|
attachments,
|
|
body,
|
|
quote,
|
|
identifier,
|
|
preview,
|
|
}: OpenGroupMessageParams) {
|
|
super({ timestamp, identifier });
|
|
this.group = group;
|
|
this.body = body;
|
|
this.attachments = attachments ?? [];
|
|
this.quote = quote;
|
|
this.preview = preview ?? [];
|
|
}
|
|
}
|