mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
Feat: Modified number action in group-participants.update (#858)
* Update GroupMetadata.ts * Update messages-recv.ts * Update process-message.ts
This commit is contained in:
@@ -269,6 +269,11 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
||||
}
|
||||
}
|
||||
break
|
||||
case 'modify':
|
||||
const oldNumber = getBinaryNodeChildren(child, 'participant').map(p => p.attrs.jid)
|
||||
msg.messageStubParameters = oldNumber || []
|
||||
msg.messageStubType = WAMessageStubType.GROUP_PARTICIPANT_CHANGE_NUMBER
|
||||
break
|
||||
case 'promote':
|
||||
case 'demote':
|
||||
case 'remove':
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Contact } from './Contact'
|
||||
|
||||
export type GroupParticipant = (Contact & { isAdmin?: boolean, isSuperAdmin?: boolean, admin?: 'admin' | 'superadmin' | null })
|
||||
|
||||
export type ParticipantAction = 'add' | 'remove' | 'promote' | 'demote'
|
||||
export type ParticipantAction = 'add' | 'remove' | 'promote' | 'demote' | 'modify'
|
||||
|
||||
export type RequestJoinAction = 'created' | 'revoked' | 'rejected'
|
||||
|
||||
|
||||
@@ -308,6 +308,10 @@ const processMessage = async(
|
||||
const participantsIncludesMe = () => participants.find(jid => areJidsSameUser(meId, jid))
|
||||
|
||||
switch (message.messageStubType) {
|
||||
case WAMessageStubType.GROUP_PARTICIPANT_CHANGE_NUMBER:
|
||||
participants = message.messageStubParameters || []
|
||||
emitParticipantsUpdate('modify')
|
||||
break
|
||||
case WAMessageStubType.GROUP_PARTICIPANT_LEAVE:
|
||||
case WAMessageStubType.GROUP_PARTICIPANT_REMOVE:
|
||||
participants = message.messageStubParameters || []
|
||||
|
||||
Reference in New Issue
Block a user