Additional work to include story=true on send

This commit is contained in:
Scott Nonnenberg 2022-10-07 10:02:08 -07:00 committed by GitHub
parent 3bfeffe502
commit 4ec48df5b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 327 additions and 170 deletions

View file

@ -942,6 +942,7 @@ export type WebAPIType = {
timestamp: number,
options: {
online?: boolean;
story?: boolean;
urgent?: boolean;
}
) => Promise<MultiRecipient200ResponseType>;
@ -2122,14 +2123,13 @@ export function initialize({
messages,
timestamp,
online: Boolean(online),
story,
urgent,
};
await _ajax({
call: 'messages',
httpType: 'PUT',
urlParameters: `/${destination}`,
urlParameters: `/${destination}?story=${booleanToString(story)}`,
jsonData,
responseType: 'json',
unauthenticated: true,
@ -2151,14 +2151,13 @@ export function initialize({
messages,
timestamp,
online: Boolean(online),
story,
urgent,
};
await _ajax({
call: 'messages',
httpType: 'PUT',
urlParameters: `/${destination}`,
urlParameters: `/${destination}?story=${booleanToString(story)}`,
jsonData,
responseType: 'json',
});
@ -2175,20 +2174,23 @@ export function initialize({
{
online,
urgent = true,
story = false,
}: {
online?: boolean;
story?: boolean;
urgent?: boolean;
}
): Promise<MultiRecipient200ResponseType> {
const onlineParam = `&online=${booleanToString(online)}`;
const urgentParam = `&urgent=${booleanToString(urgent)}`;
const storyParam = `&story=${booleanToString(story)}`;
const response = await _ajax({
call: 'multiRecipient',
httpType: 'PUT',
contentType: 'application/vnd.signal-messenger.mrm',
data,
urlParameters: `?ts=${timestamp}${onlineParam}${urgentParam}`,
urlParameters: `?ts=${timestamp}${onlineParam}${urgentParam}${storyParam}`,
responseType: 'json',
unauthenticated: true,
accessKey: Bytes.toBase64(accessKeys),