|
|
@ -1,24 +1,19 @@
|
|
|
|
import { SignalService } from '../../../../protobuf';
|
|
|
|
import { SignalService } from '../../../../protobuf';
|
|
|
|
import { fromHexToArray } from '../../../utils/String';
|
|
|
|
|
|
|
|
import { ContentMessage } from '../ContentMessage';
|
|
|
|
import { ContentMessage } from '../ContentMessage';
|
|
|
|
import { MessageParams } from '../Message';
|
|
|
|
import { MessageParams } from '../Message';
|
|
|
|
|
|
|
|
|
|
|
|
interface MessageRequestResponseParams extends MessageParams {
|
|
|
|
interface MessageRequestResponseParams extends MessageParams {
|
|
|
|
publicKey: string;
|
|
|
|
|
|
|
|
isApproved: boolean;
|
|
|
|
isApproved: boolean;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export class MessageRequestResponse extends ContentMessage {
|
|
|
|
export class MessageRequestResponse extends ContentMessage {
|
|
|
|
private readonly publicKey: Uint8Array;
|
|
|
|
|
|
|
|
private readonly isApproved: boolean;
|
|
|
|
private readonly isApproved: boolean;
|
|
|
|
|
|
|
|
|
|
|
|
constructor(params: MessageRequestResponseParams) {
|
|
|
|
constructor(params: MessageRequestResponseParams) {
|
|
|
|
super({
|
|
|
|
super({
|
|
|
|
timestamp: params.timestamp,
|
|
|
|
timestamp: params.timestamp,
|
|
|
|
publicKey: params.publicKey,
|
|
|
|
|
|
|
|
isApproved: params.isApproved,
|
|
|
|
isApproved: params.isApproved,
|
|
|
|
} as MessageRequestResponseParams);
|
|
|
|
} as MessageRequestResponseParams);
|
|
|
|
this.publicKey = fromHexToArray(params.publicKey);
|
|
|
|
|
|
|
|
this.isApproved = params.isApproved;
|
|
|
|
this.isApproved = params.isApproved;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -30,7 +25,6 @@ export class MessageRequestResponse extends ContentMessage {
|
|
|
|
|
|
|
|
|
|
|
|
public messageRequestResponseProto(): SignalService.MessageRequestResponse {
|
|
|
|
public messageRequestResponseProto(): SignalService.MessageRequestResponse {
|
|
|
|
return new SignalService.MessageRequestResponse({
|
|
|
|
return new SignalService.MessageRequestResponse({
|
|
|
|
publicKey: this.publicKey,
|
|
|
|
|
|
|
|
isApproved: this.isApproved,
|
|
|
|
isApproved: this.isApproved,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|