group events: fix serialization issue
This commit is contained in:
@@ -393,7 +393,7 @@ export const makeCommunitiesSocket = (config: SocketConfig) => {
|
||||
participant: key.remoteJid
|
||||
},
|
||||
messageStubType: WAMessageStubType.GROUP_PARTICIPANT_ADD,
|
||||
messageStubParameters: [authState.creds.me!.id],
|
||||
messageStubParameters: [JSON.stringify(authState.creds.me)],
|
||||
participant: key.remoteJid,
|
||||
messageTimestamp: unixTimestampSeconds()
|
||||
},
|
||||
|
||||
@@ -265,7 +265,7 @@ export const makeGroupsSocket = (config: SocketConfig) => {
|
||||
participant: key.remoteJid
|
||||
},
|
||||
messageStubType: WAMessageStubType.GROUP_PARTICIPANT_ADD,
|
||||
messageStubParameters: [authState.creds.me!.id],
|
||||
messageStubParameters: [JSON.stringify(authState.creds.me)],
|
||||
participant: key.remoteJid,
|
||||
messageTimestamp: unixTimestampSeconds()
|
||||
},
|
||||
|
||||
@@ -629,7 +629,7 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
||||
msg.messageStubType = WAMessageStubType.GROUP_PARTICIPANT_LEAVE
|
||||
}
|
||||
|
||||
msg.messageStubParameters = participants
|
||||
msg.messageStubParameters = participants.map(a => JSON.stringify(a))
|
||||
break
|
||||
case 'subject':
|
||||
msg.messageStubType = WAMessageStubType.GROUP_CHANGE_SUBJECT
|
||||
@@ -673,7 +673,7 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
||||
case 'created_membership_requests':
|
||||
msg.messageStubType = WAMessageStubType.GROUP_MEMBERSHIP_JOIN_APPROVAL_REQUEST_NON_ADMIN_ADD
|
||||
msg.messageStubParameters = [
|
||||
{ lid: affectedParticipantLid, pn: affectedParticipantPn } as LIDMapping,
|
||||
JSON.stringify({ lid: affectedParticipantLid, pn: affectedParticipantPn }),
|
||||
'created',
|
||||
child.attrs.request_method!
|
||||
]
|
||||
@@ -683,7 +683,7 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
||||
// TODO: LIDMAPPING SUPPORT
|
||||
msg.messageStubType = WAMessageStubType.GROUP_MEMBERSHIP_JOIN_APPROVAL_REQUEST_NON_ADMIN_ADD
|
||||
msg.messageStubParameters = [
|
||||
{ lid: affectedParticipantLid, pn: affectedParticipantPn } as LIDMapping,
|
||||
JSON.stringify({ lid: affectedParticipantLid, pn: affectedParticipantPn }),
|
||||
isDenied ? 'revoked' : 'rejected'
|
||||
]
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user