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