feat(business): change profile/cover photo and manage quick replies (#1724)
This commit is contained in:
@@ -666,6 +666,22 @@ export const chatModificationToAppPatch = (mod: ChatModification, jid: string) =
|
||||
apiVersion: 1,
|
||||
operation: OP.SET
|
||||
}
|
||||
} else if ('quickReply' in mod) {
|
||||
patch = {
|
||||
syncAction: {
|
||||
quickReplyAction: {
|
||||
count: 0,
|
||||
deleted: mod.quickReply.deleted || false,
|
||||
keywords: [],
|
||||
message: mod.quickReply.message || '',
|
||||
shortcut: mod.quickReply.shortcut || ''
|
||||
}
|
||||
},
|
||||
index: ['quick_reply', mod.quickReply.timestamp || String(Math.floor(Date.now() / 1000))],
|
||||
type: 'regular',
|
||||
apiVersion: 2,
|
||||
operation: OP.SET
|
||||
}
|
||||
} else if ('addLabel' in mod) {
|
||||
patch = {
|
||||
syncAction: {
|
||||
|
||||
@@ -632,7 +632,7 @@ export const getWAUploadToServer = (
|
||||
// send a query JSON to obtain the url & auth token to upload our media
|
||||
let uploadInfo = await refreshMediaConn(false)
|
||||
|
||||
let urls: { mediaUrl: string; directPath: string } | undefined
|
||||
let urls: { mediaUrl: string; directPath: string; meta_hmac?: string; ts?: number; fbid?: number } | undefined
|
||||
const hosts = [...customUploadHosts, ...uploadInfo.hosts]
|
||||
|
||||
fileEncSha256B64 = encodeBase64EncodedStringForUpload(fileEncSha256B64)
|
||||
@@ -664,7 +664,10 @@ export const getWAUploadToServer = (
|
||||
if (result?.url || result?.directPath) {
|
||||
urls = {
|
||||
mediaUrl: result.url,
|
||||
directPath: result.direct_path
|
||||
directPath: result.direct_path,
|
||||
meta_hmac: result.meta_hmac,
|
||||
fbid: result.fbid,
|
||||
ts: result.ts
|
||||
}
|
||||
break
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user