feat(business): change profile/cover photo and manage quick replies (#1724)

This commit is contained in:
vini
2025-09-07 08:08:26 -03:00
committed by GitHub
parent 084761dc31
commit 50fc83b008
8 changed files with 217 additions and 8 deletions
+16
View File
@@ -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: {
+5 -2
View File
@@ -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 {