mirror of
https://github.com/HeyPuter/puter.git
synced 2025-02-02 23:28:39 +08:00
Send more infor in the puter.app_open
event
This commit is contained in:
parent
efd4730f75
commit
3d32f4123b
@ -55,15 +55,17 @@ router.post('/rao', auth, express.json(), async (req, res, next)=>{
|
|||||||
[req.body.app_uid, req.user.id, Math.floor(new Date().getTime() / 1000)]
|
[req.body.app_uid, req.user.id, Math.floor(new Date().getTime() / 1000)]
|
||||||
)
|
)
|
||||||
|
|
||||||
// send process even puter.app_open
|
// get app
|
||||||
|
const opened_app = await get_app({uid: req.body.app_uid});
|
||||||
|
|
||||||
|
// send process event `puter.app_open`
|
||||||
process.emit('puter.app_open', {
|
process.emit('puter.app_open', {
|
||||||
app_uid: req.body.app_uid,
|
app_uid: req.body.app_uid,
|
||||||
user_id: req.user.id,
|
user_id: req.user.id,
|
||||||
|
app_owner_user_id: opened_app.owner_user_id,
|
||||||
ts: Math.floor(new Date().getTime() / 1000)
|
ts: Math.floor(new Date().getTime() / 1000)
|
||||||
});
|
});
|
||||||
|
|
||||||
const opened_app = await get_app({uid: req.body.app_uid});
|
|
||||||
|
|
||||||
// -----------------------------------------------------------------------//
|
// -----------------------------------------------------------------------//
|
||||||
// Update the 'app opens' cache
|
// Update the 'app opens' cache
|
||||||
// -----------------------------------------------------------------------//
|
// -----------------------------------------------------------------------//
|
||||||
|
Loading…
Reference in New Issue
Block a user