refactor: use constant state & authInfo on legacy

This commit is contained in:
Adhiraj Singh
2021-12-18 19:45:58 +05:30
parent 1e97c7714e
commit 37c07937d7
4 changed files with 18 additions and 18 deletions

View File

@@ -13,7 +13,7 @@ const makeGroupsSocket = (config: LegacySocketConfig) => {
generateMessageTag,
currentEpoch,
setQuery,
getState
state
} = sock
/** Generic function for group queries */
@@ -23,7 +23,7 @@ const makeGroupsSocket = (config: LegacySocketConfig) => {
{
tag: 'group',
attrs: {
author: getState().legacy?.user?.id,
author: state.legacy?.user?.id,
id: tag,
type: type,
jid: jid,
@@ -217,7 +217,7 @@ const makeGroupsSocket = (config: LegacySocketConfig) => {
subject: result.name,
id: jid,
creation: undefined,
owner: getState().legacy?.user?.id,
owner: state.legacy?.user?.id,
participants: result.recipients!.map(({ id }) => (
{ id: jidNormalizedUser(id), isAdmin: false, isSuperAdmin: false }
))