File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -259,12 +259,18 @@ export const makeSocket = (config: SocketConfig) => {
259259 }
260260
261261 const onWhatsApp = async ( ...jids : string [ ] ) => {
262- const usyncQuery = new USyncQuery ( ) . withLIDProtocol ( ) . withContactProtocol ( )
262+ let usyncQuery = new USyncQuery ( ) . withLIDProtocol ( )
263263
264+ let contactEnabled = false ;
264265 for ( const jid of jids ) {
265266 if ( isLidUser ( jid ) ) {
266- usyncQuery . withUser ( new USyncUser ( ) . withId ( jid ) ) // intentional
267+ // usyncQuery.withUser(new USyncUser().withLid(jid)) // intentional but needs JID too
268+ continue ;
267269 } else {
270+ if ( ! contactEnabled ) {
271+ contactEnabled = true
272+ usyncQuery = usyncQuery . withContactProtocol ( )
273+ }
268274 const phone = `+${ jid . replace ( '+' , '' ) . split ( '@' ) [ 0 ] ?. split ( ':' ) [ 0 ] } `
269275 usyncQuery . withUser ( new USyncUser ( ) . withPhone ( phone ) )
270276 }
You can’t perform that action at this time.
0 commit comments