fix: typeerror on some group create

This commit is contained in:
Adhiraj Singh
2021-12-07 22:09:18 +05:30
parent 1e386480e4
commit 49e7ad4b25
3 changed files with 4 additions and 6 deletions

View File

@@ -1,6 +1,6 @@
import { generateMessageID } from "../Utils";
import { SocketConfig, GroupMetadata, ParticipantAction } from "../Types";
import { BinaryNode, getBinaryNodeChild, getBinaryNodeChildren, jidEncode } from "../WABinary";
import { BinaryNode, getBinaryNodeChild, getBinaryNodeChildren, jidEncode, jidNormalizedUser } from "../WABinary";
import { makeSocket } from "./socket";
export const makeGroupsSocket = (config: SocketConfig) => {
@@ -196,7 +196,7 @@ export const extractGroupMetadata = (result: BinaryNode) => {
id: groupId,
subject: group.attrs.subject,
creation: +group.attrs.creation,
owner: group.attrs.creator,
owner: group.attrs.creator ? jidNormalizedUser(group.attrs.creator) : undefined,
desc,
descId,
restrict: !!getBinaryNodeChild(result, 'locked'),