Update topic in channel state
This commit is contained in:
parent
e92f5d573b
commit
80a12d98b4
@ -1,12 +1,12 @@
|
||||
"use strict";
|
||||
|
||||
const $ = require("jquery");
|
||||
const socket = require("../socket");
|
||||
const helpers_parse = require("../libs/handlebars/parse");
|
||||
const {findChannel} = require("../vue");
|
||||
|
||||
socket.on("topic", function(data) {
|
||||
const topic = $("#chan-" + data.chan).find(".header .topic");
|
||||
topic.html(helpers_parse(data.topic));
|
||||
// .prop() is safe escape-wise but consider the capabilities of the attribute
|
||||
topic.prop("title", data.topic);
|
||||
let channel = findChannel(data.chan);
|
||||
|
||||
if (channel) {
|
||||
channel.channel.topic = data.topic;
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user