Skip to content

Commit

Permalink
fix: Update status v3 contacts before send
Browse files Browse the repository at this point in the history
  • Loading branch information
edgardmessias committed Jul 9, 2022
1 parent 7be642f commit 96fa79b
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions src/status/functions/sendRawStatus.ts
Expand Up @@ -15,7 +15,6 @@
*/

import * as Chat from '../../chat';
import { internalEv } from '../../eventEmitter';
import * as webpack from '../../webpack';
import {
ChatStore,
Expand Down Expand Up @@ -91,23 +90,11 @@ async function updateStatusGroup() {
if (!isForgot) {
isForgot = true;

markForgetSenderKey(group, myContacts);
await markForgetSenderKey(group, myContacts);
}
}

webpack.onInjected(() => {
let timer: any = null;

ContactStore.on('add remove', () => {
clearTimeout(timer);
timer = setTimeout(updateStatusGroup, 1000);
});

internalEv.on('conn.main_ready', () => {
clearTimeout(timer);
timer = setTimeout(updateStatusGroup, 2000);
});

// allow to send backgroundColor, textColor and font for status
wrapModuleFunction(createMsgProtobuf, (func, ...args) => {
const [msg] = args;
Expand Down Expand Up @@ -143,6 +130,8 @@ webpack.onInjected(() => {
throw error;
}

await updateStatusGroup();

let c;
if (msg.asMms) {
const t = msg.isUnsentPhoneMsg();
Expand Down

0 comments on commit 96fa79b

Please sign in to comment.