enable znc/playback even without message storage

Fixes: https://github.com/thelounge/thelounge/issues/4464
This commit is contained in:
Reto Brunner 2022-04-28 14:26:24 +02:00
parent aa7db1e7f7
commit c8115e22ac
2 changed files with 12 additions and 7 deletions

View file

@ -237,7 +237,7 @@ Chan.prototype.writeUserLog = function (client, msg) {
};
Chan.prototype.loadMessages = function (client, network) {
if (!this.isLoggable() || !client.messageProvider) {
if (!this.isLoggable()) {
return;
}
@ -249,6 +249,16 @@ Chan.prototype.loadMessages = function (client, network) {
return;
}
if (!client.messageProvider) {
if (network.irc.network.cap.isEnabled("znc.in/playback")) {
// if we do have a message provider we might be able to only fetch partial history,
// so delay the cap in this case.
requestZncPlayback(this, network, 0);
}
return;
}
client.messageProvider
.getMessages(network, this)
.then((messages) => {

View file

@ -196,13 +196,8 @@ Network.prototype.createIrcFramework = function (client) {
this.irc.requestCap([
"znc.in/self-message", // Legacy echo-message for ZNC
"znc.in/playback", // See http://wiki.znc.in/Playback
]);
// Request only new messages from ZNC if we have sqlite logging enabled
// See http://wiki.znc.in/Playback
if (client.messageProvider) {
this.irc.requestCap("znc.in/playback");
}
};
Network.prototype.setIrcFrameworkOptions = function (client) {