Adding protobuf changes for message request response.

pull/2170/head
warrickct 3 years ago
parent 436d22bafd
commit cdeac8f424

@ -35,6 +35,12 @@ message Unsend {
required string author = 2;
}
message MessageRequestResponse {
// @required
required bytes publicKey = 1; // The public key of the contact that was approved
// @required
required bool isApproved = 2;
}
message Content {
optional DataMessage dataMessage = 1;
@ -44,6 +50,7 @@ message Content {
optional ConfigurationMessage configurationMessage = 7;
optional DataExtractionNotification dataExtractionNotification = 8;
optional Unsend unsendMessage = 9;
optional MessageRequestResponse messageRequestResponse = 10;
}
message KeyPair {
@ -195,6 +202,7 @@ message ConfigurationMessage {
optional bytes profileKey = 4;
optional bool isApproved = 5;
optional bool isBlocked = 6;
optional bool didApproveMe = 7;
}
repeated ClosedGroup closedGroups = 1;

@ -0,0 +1,36 @@
import { SignalService } from '../../../../protobuf';
import { ContentMessage } from '../ContentMessage';
import { MessageParams } from '../Message';
interface MessageRequestResponseParams extends MessageParams {
publicKey: Uint8Array;
isApproved: boolean;
}
export class MessageRequestResponse extends ContentMessage {
private readonly publicKey: Uint8Array;
private readonly isApproved: boolean;
constructor(params: MessageRequestResponseParams) {
super({
timestamp: params.timestamp,
publicKey: params.publicKey,
isApproved: params.isApproved,
} as MessageRequestResponseParams);
this.publicKey = params.publicKey;
this.isApproved = params.isApproved;
}
public contentProto(): SignalService.Content {
return new SignalService.Content({
messageRequestResponse: this.messageRequestResponseProto(),
});
}
public messageRequestResponseProto(): SignalService.MessageRequestResponse {
return new SignalService.MessageRequestResponse({
publicKey: this.publicKey,
isApproved: this.isApproved,
});
}
}
Loading…
Cancel
Save