2017-05-18 20:08:54 +00:00
|
|
|
"use strict";
|
|
|
|
|
2019-11-16 17:24:03 +00:00
|
|
|
import socket from "../socket";
|
|
|
|
import store from "../store";
|
2017-05-18 20:08:54 +00:00
|
|
|
|
|
|
|
socket.on("users", function(data) {
|
2019-11-02 19:40:59 +00:00
|
|
|
if (store.state.activeChannel && store.state.activeChannel.channel.id === data.chan) {
|
2018-07-08 12:18:17 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
|
2019-11-03 14:59:43 +00:00
|
|
|
const channel = store.getters.findChannel(data.chan);
|
2018-07-08 12:18:17 +00:00
|
|
|
|
|
|
|
if (channel) {
|
|
|
|
channel.channel.usersOutdated = true;
|
2017-05-18 20:08:54 +00:00
|
|
|
}
|
|
|
|
});
|