2017-05-18 20:08:54 +00:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
const socket = require("../socket");
|
2018-07-08 12:18:17 +00:00
|
|
|
const {vueApp, findChannel} = require("../vue");
|
2017-05-18 20:08:54 +00:00
|
|
|
|
|
|
|
socket.on("users", function(data) {
|
2018-07-08 12:18:17 +00:00
|
|
|
if (vueApp.activeChannel && vueApp.activeChannel.channel.id === data.chan) {
|
|
|
|
return socket.emit("names", {
|
2017-11-15 06:35:15 +00:00
|
|
|
target: data.chan,
|
2017-05-18 20:08:54 +00:00
|
|
|
});
|
2018-07-08 12:18:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
const channel = findChannel(data.chan);
|
|
|
|
|
|
|
|
if (channel) {
|
|
|
|
channel.channel.usersOutdated = true;
|
2017-05-18 20:08:54 +00:00
|
|
|
}
|
|
|
|
});
|