@@ -342,7 +342,7 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
342
342
343
343
break
344
344
case 'membership_approval_mode' :
345
- const approvalMode : any = getBinaryNodeChild ( child , 'group_join' )
345
+ const approvalMode = getBinaryNodeChild ( child , 'group_join' )
346
346
if ( approvalMode ) {
347
347
msg . messageStubType = WAMessageStubType . GROUP_MEMBERSHIP_JOIN_APPROVAL_MODE
348
348
msg . messageStubParameters = [ approvalMode . attrs . state ]
@@ -574,8 +574,7 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
574
574
575
575
logger . debug ( { participant, sendToAll } , 'forced new session for retry recp' )
576
576
577
- for ( let i = 0 ; i < msgs . length ; i ++ ) {
578
- const msg = msgs [ i ]
577
+ for ( const [ i , msg ] of msgs . entries ( ) ) {
579
578
if ( msg ) {
580
579
updateSendMessageAgainCount ( ids [ i ] , participant )
581
580
const msgRelayOpts : MessageRelayOptions = { messageId : ids [ i ] }
@@ -761,10 +760,8 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
761
760
msg . messageStubParameters = [ NO_MESSAGE_FOUND_ERROR_TEXT , response ]
762
761
}
763
762
764
- if ( msg . message ?. protocolMessage ?. type === proto . Message . ProtocolMessage . Type . SHARE_PHONE_NUMBER ) {
765
- if ( node . attrs . sender_pn ) {
766
- ev . emit ( 'chats.phoneNumberShare' , { lid : node . attrs . from , jid : node . attrs . sender_pn } )
767
- }
763
+ if ( msg . message ?. protocolMessage ?. type === proto . Message . ProtocolMessage . Type . SHARE_PHONE_NUMBER && node . attrs . sender_pn ) {
764
+ ev . emit ( 'chats.phoneNumberShare' , { lid : node . attrs . from , jid : node . attrs . sender_pn } )
768
765
}
769
766
770
767
try {
@@ -851,7 +848,7 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
851
848
return sendPeerDataOperationMessage ( pdoMessage )
852
849
}
853
850
854
- const requestPlaceholderResend = async ( messageKey : WAMessageKey ) : Promise < 'RESOLVED' | string | undefined > => {
851
+ const requestPlaceholderResend = async ( messageKey : WAMessageKey ) : Promise < string | undefined > => {
855
852
if ( ! authState . creds . me ?. id ) {
856
853
throw new Boom ( 'Not authenticated' )
857
854
}
0 commit comments