Binato/server/Packets/ChangeAction.js

11 lines
378 B
JavaScript
Raw Permalink Normal View History

2022-08-26 12:52:00 +01:00
const StatusUpdate = require("./StatusUpdate.js"),
Streams = require("../Streams.js");
2020-08-27 13:09:35 +01:00
module.exports = function(currentUser, data) {
currentUser.updatePresence(data);
2022-08-26 12:52:00 +01:00
if (Streams.exists(`sp_${currentUser.username}`)) {
const statusUpdate = StatusUpdate(currentUser, currentUser.id, false);
2022-08-26 12:52:00 +01:00
Streams.sendToStream(`sp_${currentUser.username}`, statusUpdate, null);
}
2020-08-27 13:09:35 +01:00
}