Support endorsements for group 1:1 sends
Co-authored-by: trevor-signal <131492920+trevor-signal@users.noreply.github.com>
This commit is contained in:
parent
76a77a9b7f
commit
e617981e59
26 changed files with 1296 additions and 796 deletions
|
@ -36,8 +36,6 @@ import {
|
|||
import type {
|
||||
ChallengeType,
|
||||
GetGroupLogOptionsType,
|
||||
GetProfileOptionsType,
|
||||
GetProfileUnauthOptionsType,
|
||||
GroupCredentialsType,
|
||||
GroupLogResponseType,
|
||||
ProxiedRequestOptionsType,
|
||||
|
@ -103,12 +101,22 @@ import {
|
|||
getProtoForCallHistory,
|
||||
} from '../util/callDisposition';
|
||||
import { MAX_MESSAGE_COUNT } from '../util/deleteForMe.types';
|
||||
import type { GroupSendToken } from '../types/GroupSendEndorsements';
|
||||
|
||||
export type SendIdentifierData =
|
||||
| {
|
||||
accessKey: string;
|
||||
senderCertificate: SerializedCertificateType | null;
|
||||
groupSendToken: null;
|
||||
}
|
||||
| {
|
||||
accessKey: null;
|
||||
senderCertificate: SerializedCertificateType | null;
|
||||
groupSendToken: GroupSendToken;
|
||||
};
|
||||
|
||||
export type SendMetadataType = {
|
||||
[serviceId: ServiceIdString]: {
|
||||
accessKey: string;
|
||||
senderCertificate?: SerializedCertificateType;
|
||||
};
|
||||
[serviceId: ServiceIdString]: SendIdentifierData;
|
||||
};
|
||||
|
||||
export type SendOptionsType = {
|
||||
|
@ -2321,17 +2329,6 @@ export default class MessageSender {
|
|||
// Note: instead of updating these functions, or adding new ones, remove these and go
|
||||
// directly to window.textsecure.messaging.server.<function>
|
||||
|
||||
async getProfile(
|
||||
serviceId: ServiceIdString,
|
||||
options: GetProfileOptionsType | GetProfileUnauthOptionsType
|
||||
): ReturnType<WebAPIType['getProfile']> {
|
||||
if (options.accessKey !== undefined) {
|
||||
return this.server.getProfileUnauth(serviceId, options);
|
||||
}
|
||||
|
||||
return this.server.getProfile(serviceId, options);
|
||||
}
|
||||
|
||||
async getAvatar(path: string): Promise<ReturnType<WebAPIType['getAvatar']>> {
|
||||
return this.server.getAvatar(path);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue