From 54a8ca57a517ee7c316623094727b92493cf3a91 Mon Sep 17 00:00:00 2001 From: bqv Date: Mon, 21 Mar 2022 13:47:05 +0000 Subject: [PATCH] merge muc pm buffers --- channel.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/channel.cpp b/channel.cpp index 6ee2b7d..4df14d2 100644 --- a/channel.cpp +++ b/channel.cpp @@ -20,6 +20,7 @@ #include "buffer.hh" #include "pgp.hh" #include "util.hh" +#include "xmpp/node.hh" const char *channel__transport_name(enum t_channel_transport transport) { @@ -297,6 +298,14 @@ struct t_channel *channel__new(struct t_account *account, ptr_buffer = channel__create_buffer(account, type, name); if (!ptr_buffer) return NULL; + else if (type == CHANNEL_TYPE_PM) + { + ptr_channel = channel__search(account, jid(account->context, id).bare.data()); + if (ptr_channel) + { + weechat_buffer_merge(ptr_buffer, ptr_channel->buffer); + } + } if ((new_channel = (struct t_channel*)malloc(sizeof(*new_channel))) == NULL) return NULL;