2017-05-18 22:08:54 +02:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
const socket = require("../socket");
|
2018-07-12 12:59:03 +02:00
|
|
|
const {findChannel} = require("../vue");
|
2017-05-18 22:08:54 +02:00
|
|
|
|
|
|
|
socket.on("more", function(data) {
|
2018-07-08 14:18:17 +02:00
|
|
|
const channel = findChannel(data.chan);
|
2018-02-20 08:28:04 +01:00
|
|
|
|
2018-07-08 14:18:17 +02:00
|
|
|
if (!channel) {
|
|
|
|
return;
|
2017-05-18 22:08:54 +02:00
|
|
|
}
|
|
|
|
|
2018-07-10 18:51:45 +02:00
|
|
|
channel.channel.moreHistoryAvailable = data.moreHistoryAvailable;
|
2018-07-08 14:18:17 +02:00
|
|
|
channel.channel.messages.unshift(...data.messages);
|
2018-07-08 15:42:54 +02:00
|
|
|
channel.channel.historyLoading = false;
|
2017-05-18 22:08:54 +02:00
|
|
|
});
|