2017-05-18 22:08:54 +02:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
const socket = require("../socket");
|
2019-11-02 20:40:59 +01:00
|
|
|
const {findChannel} = require("../vue");
|
|
|
|
const store = require("../store").default;
|
2017-05-18 22:08:54 +02:00
|
|
|
|
|
|
|
socket.on("users", function(data) {
|
2019-11-02 20:40:59 +01:00
|
|
|
if (store.state.activeChannel && store.state.activeChannel.channel.id === data.chan) {
|
2018-07-08 14:18:17 +02:00
|
|
|
return socket.emit("names", {
|
2017-11-15 07:35:15 +01:00
|
|
|
target: data.chan,
|
2017-05-18 22:08:54 +02:00
|
|
|
});
|
2018-07-08 14:18:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
const channel = findChannel(data.chan);
|
|
|
|
|
|
|
|
if (channel) {
|
|
|
|
channel.channel.usersOutdated = true;
|
2017-05-18 22:08:54 +02:00
|
|
|
}
|
|
|
|
});
|