hardlounge/client/js/socket-events/users.js
2019-02-12 12:48:42 +02:00

19 lines
385 B
JavaScript

"use strict";
const socket = require("../socket");
const {vueApp, findChannel} = require("../vue");
socket.on("users", function(data) {
if (vueApp.activeChannel && vueApp.activeChannel.channel.id === data.chan) {
return socket.emit("names", {
target: data.chan,
});
}
const channel = findChannel(data.chan);
if (channel) {
channel.channel.usersOutdated = true;
}
});