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.
38 lines
1000 B
TypeScript
38 lines
1000 B
TypeScript
5 years ago
|
import { SignalService } from '../../../../../../protobuf';
|
||
|
import { ChatMessage } from '../ChatMessage';
|
||
|
import { ClosedGroupMessage } from './ClosedGroupMessage';
|
||
5 years ago
|
|
||
5 years ago
|
interface ClosedGroupChatMessageParams {
|
||
|
identifier?: string;
|
||
5 years ago
|
groupId: string;
|
||
|
chatMessage: ChatMessage;
|
||
|
}
|
||
|
|
||
5 years ago
|
export class ClosedGroupChatMessage extends ClosedGroupMessage {
|
||
5 years ago
|
private readonly chatMessage: ChatMessage;
|
||
|
|
||
|
constructor(params: ClosedGroupChatMessageParams) {
|
||
|
super({
|
||
5 years ago
|
timestamp: params.chatMessage.timestamp,
|
||
5 years ago
|
identifier: params.identifier,
|
||
5 years ago
|
groupId: params.groupId,
|
||
5 years ago
|
});
|
||
|
this.chatMessage = params.chatMessage;
|
||
|
}
|
||
|
|
||
|
public ttl(): number {
|
||
|
return this.getDefaultTTL();
|
||
|
}
|
||
|
|
||
5 years ago
|
protected groupContextType(): SignalService.GroupContext.Type {
|
||
|
return SignalService.GroupContext.Type.DELIVER;
|
||
|
}
|
||
|
|
||
5 years ago
|
protected dataProto(): SignalService.DataMessage {
|
||
|
const messageProto = this.chatMessage.dataProto();
|
||
5 years ago
|
messageProto.group = this.groupContext();
|
||
5 years ago
|
|
||
|
return messageProto;
|
||
|
}
|
||
|
}
|