⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.142
Server IP:
217.76.53.76
Server:
Linux vmi1397931.contaboserver.net 5.4.0-105-generic #119-Ubuntu SMP Mon Mar 7 18:49:24 UTC 2022 x86_64
Server Software:
Apache
PHP Version:
8.2.27
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
www
/
wwwroot
/
whatxap.com
/
src
/
wp
/
controllers
/
View File Name :
getMessages.js
import { getSession } from './../../whatsapp.js' import response from './../../response.js' const getMessages = async (req, res) => { const session = getSession(res.locals.sessionId) /* eslint-disable camelcase */ const { jid } = req.params const { limit = 25, cursor_id = null, cursor_fromMe = null } = req.query const cursor = {} if (cursor_id) { cursor.before = { id: cursor_id, fromMe: Boolean(cursor_fromMe && cursor_fromMe === 'true'), } } /* eslint-enable camelcase */ try { let messages const useCursor = 'before' in cursor ? cursor : null if (session.isLegacy) { messages = await session.fetchMessagesFromWA(jid, limit, useCursor) } else { messages = await session.store.loadMessages(jid, limit, useCursor) } response(res, 200, true, '', messages) } catch { response(res, 500, false, 'Failed to load messages.') } } export default getMessages