diff --git a/src/messagefiltermodel.cpp b/src/messagefiltermodel.cpp index 057f5c5e7..d13f24d35 100644 --- a/src/messagefiltermodel.cpp +++ b/src/messagefiltermodel.cpp @@ -6,6 +6,15 @@ #include "messageeventmodel.h" #include "neochatconfig.h" +MessageFilterModel::MessageFilterModel(QObject *parent) + : QSortFilterProxyModel(parent) +{ + connect(NeoChatConfig::self(), &NeoChatConfig::ShowLeaveJoinEventChanged, this, [this] { + beginResetModel(); + endResetModel(); + }); +} + bool MessageFilterModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const { const QModelIndex index = sourceModel()->index(sourceRow, 0, sourceParent); diff --git a/src/messagefiltermodel.h b/src/messagefiltermodel.h index a0b19c663..02ac34942 100644 --- a/src/messagefiltermodel.h +++ b/src/messagefiltermodel.h @@ -9,5 +9,6 @@ class MessageFilterModel : public QSortFilterProxyModel { Q_OBJECT public: + MessageFilterModel(QObject *parent = nullptr); bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override; };