feat: add toggle to download history

This commit is contained in:
Adhiraj Singh
2022-05-22 17:23:30 +05:30
parent 85a58fbc10
commit 9a39a46398
4 changed files with 27 additions and 12 deletions

View File

@@ -13,7 +13,8 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
const {
logger,
treatCiphertextMessagesAsReal,
retryRequestDelayMs
retryRequestDelayMs,
downloadHistory
} = config
const sock = makeChatsSocket(config)
const {
@@ -149,7 +150,15 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
// process message and emit events
const newEvents = await processMessage(
msg,
{ historyCache, meId, accountSettings: authState.creds.accountSettings, keyStore: authState.keys, logger, treatCiphertextMessagesAsReal }
{
downloadHistory,
historyCache,
meId,
accountSettings: authState.creds.accountSettings,
keyStore: authState.keys,
logger,
treatCiphertextMessagesAsReal
}
)
// send ack for history message