mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
fix group announce and restrict always false (#971)
* fix group announce and restrict always false * refactor: make group setting change params in line with WA Co-authored-by: Adhiraj Singh <adhirajsingh1001@gmail.com>
This commit is contained in:
@@ -206,12 +206,12 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
||||
emitParticipantsUpdate('add')
|
||||
break
|
||||
case WAMessageStubType.GROUP_CHANGE_ANNOUNCE:
|
||||
const announce = message.messageStubParameters[0] === 'on'
|
||||
emitGroupUpdate({ announce })
|
||||
const announceValue = message.messageStubParameters[0]
|
||||
emitGroupUpdate({ announce: announceValue === 'true' || announceValue === 'on' })
|
||||
break
|
||||
case WAMessageStubType.GROUP_CHANGE_RESTRICT:
|
||||
const restrict = message.messageStubParameters[0] === 'on'
|
||||
emitGroupUpdate({ restrict })
|
||||
const restrictValue = message.messageStubParameters[0]
|
||||
emitGroupUpdate({ restrict: restrictValue === 'true' || restrictValue === 'on' })
|
||||
break
|
||||
case WAMessageStubType.GROUP_CHANGE_SUBJECT:
|
||||
chatUpdate.name = message.messageStubParameters[0]
|
||||
@@ -321,12 +321,12 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
||||
case 'announcement':
|
||||
case 'not_announcement':
|
||||
result.messageStubType = WAMessageStubType.GROUP_CHANGE_ANNOUNCE
|
||||
result.messageStubParameters = [ (child.tag === 'announcement').toString() ]
|
||||
result.messageStubParameters = [ (child.tag === 'announcement') ? 'on' : 'off' ]
|
||||
break
|
||||
case 'locked':
|
||||
case 'unlocked':
|
||||
result.messageStubType = WAMessageStubType.GROUP_CHANGE_RESTRICT
|
||||
result.messageStubParameters = [ (child.tag === 'locked').toString() ]
|
||||
result.messageStubParameters = [ (child.tag === 'locked') ? 'on' : 'off' ]
|
||||
break
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user