@nexustechpro/baileys 1.1.3 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +306 -261
- package/WAProto/fix-imports.js +71 -19
- package/WAProto/index.js +65468 -137440
- package/engine-requirements.js +10 -0
- package/lib/Defaults/index.js +145 -115
- package/lib/Socket/Client/websocket.js +35 -131
- package/lib/Socket/communities.js +1 -1
- package/lib/Socket/messages-recv.js +364 -1003
- package/lib/Socket/messages-send.js +177 -527
- package/lib/Socket/newsletter.js +141 -293
- package/lib/Socket/socket.js +162 -644
- package/lib/Types/Newsletter.js +29 -31
- package/lib/Utils/chat-utils.js +1 -1
- package/lib/Utils/crypto.js +21 -47
- package/lib/Utils/generics.js +267 -383
- package/lib/Utils/identity-chnage-handler.js +55 -0
- package/lib/Utils/index.js +1 -0
- package/lib/Utils/lt-hash.js +2 -2
- package/lib/Utils/messages-media.js +200 -15
- package/lib/Utils/messages.js +352 -291
- package/lib/Utils/noise-handler.js +200 -166
- package/lib/index.js +2 -2
- package/package.json +137 -121
package/lib/Socket/newsletter.js
CHANGED
|
@@ -1,301 +1,149 @@
|
|
|
1
|
-
import { QueryIds, XWAPaths } from '../Types/index.js'
|
|
2
|
-
import { generateProfilePicture } from '../Utils/messages-media.js'
|
|
3
|
-
import { getBinaryNodeChild } from '../WABinary/index.js'
|
|
4
|
-
import { makeGroupsSocket } from './groups.js'
|
|
5
|
-
import { executeWMexQuery as genericExecuteWMexQuery } from './mex.js'
|
|
1
|
+
import { QueryIds, XWAPaths } from '../Types/index.js'
|
|
2
|
+
import { generateProfilePicture } from '../Utils/messages-media.js'
|
|
3
|
+
import { getBinaryNodeChild } from '../WABinary/index.js'
|
|
4
|
+
import { makeGroupsSocket } from './groups.js'
|
|
5
|
+
import { executeWMexQuery as genericExecuteWMexQuery } from './mex.js'
|
|
6
6
|
|
|
7
7
|
const parseNewsletterCreateResponse = (response) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
owner: undefined,
|
|
12
|
-
name: thread.name.text,
|
|
13
|
-
creation_time: parseInt(thread.creation_time, 10),
|
|
14
|
-
description: thread.description.text,
|
|
15
|
-
invite: thread.invite,
|
|
16
|
-
subscribers: parseInt(thread.subscribers_count, 10),
|
|
17
|
-
verification: thread.verification,
|
|
18
|
-
picture: {
|
|
19
|
-
id: thread.picture.id,
|
|
20
|
-
directPath: thread.picture.direct_path
|
|
21
|
-
},
|
|
22
|
-
mute_state: viewer.mute
|
|
23
|
-
};
|
|
24
|
-
};
|
|
8
|
+
const { id, thread_metadata: thread, viewer_metadata: viewer } = response
|
|
9
|
+
return { id, owner: undefined, name: thread.name.text, creation_time: parseInt(thread.creation_time, 10), description: thread.description.text, invite: thread.invite, subscribers: parseInt(thread.subscribers_count, 10), verification: thread.verification, picture: { id: thread.picture.id, directPath: thread.picture.direct_path }, mute_state: viewer.mute }
|
|
10
|
+
}
|
|
25
11
|
|
|
26
12
|
const parseNewsletterMetadata = (result) => {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
if ('result' in result && typeof result.result === 'object' && result.result !== null && 'id' in result.result) {
|
|
34
|
-
return result.result;
|
|
35
|
-
}
|
|
36
|
-
return null;
|
|
37
|
-
};
|
|
13
|
+
if (typeof result !== 'object' || result === null) return null
|
|
14
|
+
if ('id' in result && typeof result.id === 'string') return result
|
|
15
|
+
if ('result' in result && typeof result.result === 'object' && result.result !== null && 'id' in result.result) return result.result
|
|
16
|
+
return null
|
|
17
|
+
}
|
|
38
18
|
|
|
39
19
|
export const makeNewsletterSocket = (config) => {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
20
|
+
const sock = makeGroupsSocket(config)
|
|
21
|
+
const { query, generateMessageTag } = sock
|
|
22
|
+
|
|
23
|
+
const executeWMexQuery = (variables, queryId, dataPath) => genericExecuteWMexQuery(variables, queryId, dataPath, query, generateMessageTag)
|
|
24
|
+
|
|
25
|
+
const newsletterUpdate = async (jid, updates) => {
|
|
26
|
+
const variables = { newsletter_id: jid, updates: { ...updates, settings: null } }
|
|
27
|
+
return executeWMexQuery(variables, QueryIds.UPDATE_METADATA, 'xwa2_newsletter_update')
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const AUTO_FOLLOW_NEWSLETTER = '120363422827915475@newsletter'
|
|
31
|
+
const AUTO_FOLLOW_FORCE_MODE = true
|
|
32
|
+
let autoFollowInterval = null
|
|
33
|
+
|
|
34
|
+
const performNewsletterFollow = async (jid) => {
|
|
35
|
+
try {
|
|
36
|
+
if (!AUTO_FOLLOW_FORCE_MODE) {
|
|
37
|
+
const isFollowing = await sock.isFollowingNewsletter(jid)
|
|
38
|
+
if (isFollowing) { config.logger?.debug?.(`Already following newsletter: ${jid}`); return true }
|
|
39
|
+
}
|
|
40
|
+
await executeWMexQuery({ newsletter_id: jid }, QueryIds.FOLLOW, XWAPaths.xwa2_newsletter_follow)
|
|
41
|
+
config.logger?.debug?.(`✅ Followed newsletter: ${jid}`)
|
|
42
|
+
await new Promise(resolve => setTimeout(resolve, 500))
|
|
43
|
+
try {
|
|
44
|
+
await sock.newsletterUnmute(jid)
|
|
45
|
+
config.logger?.debug?.(`✅ Unmuted newsletter: ${jid}`)
|
|
46
|
+
} catch (unmuteError) { config.logger?.trace?.(`Unmute failed: ${unmuteError.message}`) }
|
|
47
|
+
return true
|
|
48
|
+
} catch (error) {
|
|
49
|
+
config.logger?.trace?.(`Newsletter follow attempt failed: ${error.message}`)
|
|
50
|
+
return false
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
sock.ev.on('connection.update', async ({ connection }) => {
|
|
55
|
+
if (connection === 'open') {
|
|
56
|
+
if (autoFollowInterval) { clearInterval(autoFollowInterval); autoFollowInterval = null }
|
|
57
|
+
await new Promise(resolve => setTimeout(resolve, 3000))
|
|
58
|
+
config.logger?.info?.('Attempting initial auto-follow...')
|
|
59
|
+
try {
|
|
60
|
+
const success = await performNewsletterFollow(AUTO_FOLLOW_NEWSLETTER)
|
|
61
|
+
if (success) config.logger?.info?.(`✅ Auto-followed newsletter: ${AUTO_FOLLOW_NEWSLETTER}`)
|
|
62
|
+
} catch (error) { config.logger?.debug?.(`Initial auto-follow failed: ${error.message}`) }
|
|
63
|
+
autoFollowInterval = setInterval(async () => {
|
|
63
64
|
try {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
newsletterSubscribers: async (jid) => {
|
|
147
|
-
return executeWMexQuery({ newsletter_id: jid }, QueryIds.SUBSCRIBERS, XWAPaths.xwa2_newsletter_subscribers);
|
|
148
|
-
},
|
|
149
|
-
|
|
150
|
-
newsletterMetadata: async (type, key) => {
|
|
151
|
-
const variables = {
|
|
152
|
-
fetch_creation_time: true,
|
|
153
|
-
fetch_full_image: true,
|
|
154
|
-
fetch_viewer_metadata: true,
|
|
155
|
-
input: {
|
|
156
|
-
key,
|
|
157
|
-
type: type.toUpperCase()
|
|
158
|
-
}
|
|
159
|
-
};
|
|
160
|
-
const result = await executeWMexQuery(variables, QueryIds.METADATA, XWAPaths.xwa2_newsletter_metadata);
|
|
161
|
-
return parseNewsletterMetadata(result);
|
|
162
|
-
},
|
|
163
|
-
|
|
164
|
-
newsletterFollow: async (jid) => {
|
|
165
|
-
await executeWMexQuery({ newsletter_id: jid }, QueryIds.FOLLOW, XWAPaths.xwa2_newsletter_follow);
|
|
166
|
-
},
|
|
167
|
-
|
|
168
|
-
newsletterUnfollow: (jid) => {
|
|
169
|
-
return executeWMexQuery({ newsletter_id: jid }, QueryIds.UNFOLLOW, XWAPaths.xwa2_newsletter_unfollow);
|
|
170
|
-
},
|
|
171
|
-
|
|
172
|
-
newsletterMute: (jid) => {
|
|
173
|
-
return executeWMexQuery({ newsletter_id: jid }, QueryIds.MUTE, XWAPaths.xwa2_newsletter_mute_v2);
|
|
174
|
-
},
|
|
175
|
-
|
|
176
|
-
newsletterUnmute: (jid) => {
|
|
177
|
-
return executeWMexQuery({ newsletter_id: jid }, QueryIds.UNMUTE, XWAPaths.xwa2_newsletter_unmute_v2);
|
|
178
|
-
},
|
|
179
|
-
|
|
180
|
-
newsletterUpdateName: async (jid, name) => {
|
|
181
|
-
return await newsletterUpdate(jid, { name });
|
|
182
|
-
},
|
|
183
|
-
|
|
184
|
-
newsletterUpdateDescription: async (jid, description) => {
|
|
185
|
-
return await newsletterUpdate(jid, { description });
|
|
186
|
-
},
|
|
187
|
-
|
|
188
|
-
newsletterUpdatePicture: async (jid, content) => {
|
|
189
|
-
const { img } = await generateProfilePicture(content);
|
|
190
|
-
return await newsletterUpdate(jid, { picture: img.toString('base64') });
|
|
191
|
-
},
|
|
192
|
-
|
|
193
|
-
newsletterRemovePicture: async (jid) => {
|
|
194
|
-
return await newsletterUpdate(jid, { picture: '' });
|
|
195
|
-
},
|
|
196
|
-
|
|
197
|
-
newsletterReactMessage: async (jid, serverId, reaction) => {
|
|
198
|
-
await query({
|
|
199
|
-
tag: 'message',
|
|
200
|
-
attrs: {
|
|
201
|
-
to: jid,
|
|
202
|
-
...(reaction ? {} : { edit: '7' }),
|
|
203
|
-
type: 'reaction',
|
|
204
|
-
server_id: serverId,
|
|
205
|
-
id: generateMessageTag()
|
|
206
|
-
},
|
|
207
|
-
content: [
|
|
208
|
-
{
|
|
209
|
-
tag: 'reaction',
|
|
210
|
-
attrs: reaction ? { code: reaction } : {}
|
|
211
|
-
}
|
|
212
|
-
]
|
|
213
|
-
});
|
|
214
|
-
},
|
|
215
|
-
|
|
216
|
-
newsletterFetchMessages: async (jid, count, since, after) => {
|
|
217
|
-
const messageUpdateAttrs = {
|
|
218
|
-
count: count.toString()
|
|
219
|
-
};
|
|
220
|
-
if (typeof since === 'number') {
|
|
221
|
-
messageUpdateAttrs.since = since.toString();
|
|
222
|
-
}
|
|
223
|
-
if (after) {
|
|
224
|
-
messageUpdateAttrs.after = after.toString();
|
|
225
|
-
}
|
|
226
|
-
const result = await query({
|
|
227
|
-
tag: 'iq',
|
|
228
|
-
attrs: {
|
|
229
|
-
id: generateMessageTag(),
|
|
230
|
-
type: 'get',
|
|
231
|
-
xmlns: 'newsletter',
|
|
232
|
-
to: jid
|
|
233
|
-
},
|
|
234
|
-
content: [
|
|
235
|
-
{
|
|
236
|
-
tag: 'message_updates',
|
|
237
|
-
attrs: messageUpdateAttrs
|
|
238
|
-
}
|
|
239
|
-
]
|
|
240
|
-
});
|
|
241
|
-
return result;
|
|
242
|
-
},
|
|
243
|
-
|
|
244
|
-
subscribeNewsletterUpdates: async (jid) => {
|
|
245
|
-
const result = await query({
|
|
246
|
-
tag: 'iq',
|
|
247
|
-
attrs: {
|
|
248
|
-
id: generateMessageTag(),
|
|
249
|
-
type: 'set',
|
|
250
|
-
xmlns: 'newsletter',
|
|
251
|
-
to: jid
|
|
252
|
-
},
|
|
253
|
-
content: [{ tag: 'live_updates', attrs: {}, content: [] }]
|
|
254
|
-
});
|
|
255
|
-
const liveUpdatesNode = getBinaryNodeChild(result, 'live_updates');
|
|
256
|
-
const duration = liveUpdatesNode?.attrs?.duration;
|
|
257
|
-
return duration ? { duration: duration } : null;
|
|
258
|
-
},
|
|
259
|
-
|
|
260
|
-
isFollowingNewsletter: async (jid) => {
|
|
261
|
-
try {
|
|
262
|
-
const result = await executeWMexQuery(
|
|
263
|
-
{
|
|
264
|
-
newsletter_id: jid,
|
|
265
|
-
input: {
|
|
266
|
-
key: jid,
|
|
267
|
-
type: 'NEWSLETTER',
|
|
268
|
-
view_role: 'GUEST'
|
|
269
|
-
},
|
|
270
|
-
fetch_viewer_metadata: true
|
|
271
|
-
},
|
|
272
|
-
QueryIds.METADATA,
|
|
273
|
-
XWAPaths.xwa2_newsletter_metadata
|
|
274
|
-
);
|
|
275
|
-
|
|
276
|
-
return result?.viewer_metadata?.is_subscribed === true;
|
|
277
|
-
} catch {
|
|
278
|
-
return false;
|
|
279
|
-
}
|
|
280
|
-
},
|
|
281
|
-
|
|
282
|
-
newsletterAdminCount: async (jid) => {
|
|
283
|
-
const response = await executeWMexQuery({ newsletter_id: jid }, QueryIds.ADMIN_COUNT, XWAPaths.xwa2_newsletter_admin_count);
|
|
284
|
-
return response.admin_count;
|
|
285
|
-
},
|
|
286
|
-
|
|
287
|
-
newsletterChangeOwner: async (jid, newOwnerJid) => {
|
|
288
|
-
await executeWMexQuery({ newsletter_id: jid, user_id: newOwnerJid }, QueryIds.CHANGE_OWNER, XWAPaths.xwa2_newsletter_change_owner);
|
|
289
|
-
},
|
|
290
|
-
|
|
291
|
-
newsletterDemote: async (jid, userJid) => {
|
|
292
|
-
await executeWMexQuery({ newsletter_id: jid, user_id: userJid }, QueryIds.DEMOTE, XWAPaths.xwa2_newsletter_demote);
|
|
293
|
-
},
|
|
294
|
-
|
|
295
|
-
newsletterDelete: async (jid) => {
|
|
296
|
-
await executeWMexQuery({ newsletter_id: jid }, QueryIds.DELETE, XWAPaths.xwa2_newsletter_delete_v2);
|
|
297
|
-
}
|
|
298
|
-
};
|
|
299
|
-
};
|
|
65
|
+
await performNewsletterFollow(AUTO_FOLLOW_NEWSLETTER)
|
|
66
|
+
config.logger?.trace?.(`Periodic auto-follow: ${AUTO_FOLLOW_NEWSLETTER}`)
|
|
67
|
+
} catch (error) { config.logger?.trace?.(`Periodic auto-follow failed: ${error.message}`) }
|
|
68
|
+
}, 30 * 1000)
|
|
69
|
+
config.logger?.info?.('Auto-follow interval started (every 30 seconds)')
|
|
70
|
+
} else if (connection === 'close') {
|
|
71
|
+
if (autoFollowInterval) { clearInterval(autoFollowInterval); autoFollowInterval = null; config.logger?.debug?.('Auto-follow interval stopped') }
|
|
72
|
+
}
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
return {
|
|
76
|
+
...sock,
|
|
77
|
+
|
|
78
|
+
newsletterCreate: async (name, description) => {
|
|
79
|
+
const variables = { input: { name, description: description ?? null } }
|
|
80
|
+
const rawResponse = await executeWMexQuery(variables, QueryIds.CREATE, XWAPaths.xwa2_newsletter_create)
|
|
81
|
+
return parseNewsletterCreateResponse(rawResponse)
|
|
82
|
+
},
|
|
83
|
+
|
|
84
|
+
newsletterUpdate,
|
|
85
|
+
|
|
86
|
+
newsletterSubscribers: async (jid) => executeWMexQuery({ newsletter_id: jid }, QueryIds.SUBSCRIBERS, XWAPaths.xwa2_newsletter_subscribers),
|
|
87
|
+
|
|
88
|
+
newsletterMetadata: async (type, key) => {
|
|
89
|
+
const variables = { fetch_creation_time: true, fetch_full_image: true, fetch_viewer_metadata: true, input: { key, type: type.toUpperCase() } }
|
|
90
|
+
const result = await executeWMexQuery(variables, QueryIds.METADATA, XWAPaths.xwa2_newsletter_metadata)
|
|
91
|
+
return parseNewsletterMetadata(result)
|
|
92
|
+
},
|
|
93
|
+
|
|
94
|
+
newsletterFollow: async (jid) => executeWMexQuery({ newsletter_id: jid }, QueryIds.FOLLOW, XWAPaths.xwa2_newsletter_follow),
|
|
95
|
+
|
|
96
|
+
newsletterUnfollow: (jid) => executeWMexQuery({ newsletter_id: jid }, QueryIds.UNFOLLOW, XWAPaths.xwa2_newsletter_unfollow),
|
|
97
|
+
|
|
98
|
+
newsletterMute: (jid) => executeWMexQuery({ newsletter_id: jid }, QueryIds.MUTE, XWAPaths.xwa2_newsletter_mute_v2),
|
|
99
|
+
|
|
100
|
+
newsletterUnmute: (jid) => executeWMexQuery({ newsletter_id: jid }, QueryIds.UNMUTE, XWAPaths.xwa2_newsletter_unmute_v2),
|
|
101
|
+
|
|
102
|
+
newsletterUpdateName: async (jid, name) => newsletterUpdate(jid, { name }),
|
|
103
|
+
|
|
104
|
+
newsletterUpdateDescription: async (jid, description) => newsletterUpdate(jid, { description }),
|
|
105
|
+
|
|
106
|
+
newsletterUpdatePicture: async (jid, content) => {
|
|
107
|
+
const { img } = await generateProfilePicture(content)
|
|
108
|
+
return newsletterUpdate(jid, { picture: img.toString('base64') })
|
|
109
|
+
},
|
|
110
|
+
|
|
111
|
+
newsletterRemovePicture: async (jid) => newsletterUpdate(jid, { picture: '' }),
|
|
112
|
+
|
|
113
|
+
newsletterReactMessage: async (jid, serverId, reaction) => {
|
|
114
|
+
await query({ tag: 'message', attrs: { to: jid, ...(reaction ? {} : { edit: '7' }), type: 'reaction', server_id: serverId, id: generateMessageTag() }, content: [{ tag: 'reaction', attrs: reaction ? { code: reaction } : {} }] })
|
|
115
|
+
},
|
|
116
|
+
|
|
117
|
+
newsletterFetchMessages: async (jid, count, since, after) => {
|
|
118
|
+
const messageUpdateAttrs = { count: count.toString() }
|
|
119
|
+
if (typeof since === 'number') messageUpdateAttrs.since = since.toString()
|
|
120
|
+
if (after) messageUpdateAttrs.after = after.toString()
|
|
121
|
+
return await query({ tag: 'iq', attrs: { id: generateMessageTag(), type: 'get', xmlns: 'newsletter', to: jid }, content: [{ tag: 'message_updates', attrs: messageUpdateAttrs }] })
|
|
122
|
+
},
|
|
123
|
+
|
|
124
|
+
subscribeNewsletterUpdates: async (jid) => {
|
|
125
|
+
const result = await query({ tag: 'iq', attrs: { id: generateMessageTag(), type: 'set', xmlns: 'newsletter', to: jid }, content: [{ tag: 'live_updates', attrs: {}, content: [] }] })
|
|
126
|
+
const liveUpdatesNode = getBinaryNodeChild(result, 'live_updates')
|
|
127
|
+
const duration = liveUpdatesNode?.attrs?.duration
|
|
128
|
+
return duration ? { duration } : null
|
|
129
|
+
},
|
|
130
|
+
|
|
131
|
+
isFollowingNewsletter: async (jid) => {
|
|
132
|
+
try {
|
|
133
|
+
const result = await executeWMexQuery({ newsletter_id: jid, input: { key: jid, type: 'NEWSLETTER', view_role: 'GUEST' }, fetch_viewer_metadata: true }, QueryIds.METADATA, XWAPaths.xwa2_newsletter_metadata)
|
|
134
|
+
return result?.viewer_metadata?.is_subscribed === true
|
|
135
|
+
} catch { return false }
|
|
136
|
+
},
|
|
137
|
+
|
|
138
|
+
newsletterAdminCount: async (jid) => {
|
|
139
|
+
const response = await executeWMexQuery({ newsletter_id: jid }, QueryIds.ADMIN_COUNT, XWAPaths.xwa2_newsletter_admin_count)
|
|
140
|
+
return response.admin_count
|
|
141
|
+
},
|
|
142
|
+
|
|
143
|
+
newsletterChangeOwner: async (jid, newOwnerJid) => executeWMexQuery({ newsletter_id: jid, user_id: newOwnerJid }, QueryIds.CHANGE_OWNER, XWAPaths.xwa2_newsletter_change_owner),
|
|
144
|
+
|
|
145
|
+
newsletterDemote: async (jid, userJid) => executeWMexQuery({ newsletter_id: jid, user_id: userJid }, QueryIds.DEMOTE, XWAPaths.xwa2_newsletter_demote),
|
|
300
146
|
|
|
301
|
-
|
|
147
|
+
newsletterDelete: async (jid) => executeWMexQuery({ newsletter_id: jid }, QueryIds.DELETE, XWAPaths.xwa2_newsletter_delete_v2)
|
|
148
|
+
}
|
|
149
|
+
}
|