Add option to disable showing new join and leave events
This commit is contained in:
@@ -17,11 +17,15 @@ Kirigami.ScrollablePage {
|
||||
|
||||
Kirigami.FormLayout {
|
||||
QQC2.CheckBox {
|
||||
id: showNotifications
|
||||
Kirigami.FormData.label: i18n("Show Notifications:")
|
||||
Kirigami.FormData.label: i18n("Show notifications:")
|
||||
checked: Config.showNotifications
|
||||
onToggled: Config.showNotifications = checked
|
||||
}
|
||||
QQC2.CheckBox {
|
||||
Kirigami.FormData.label: i18n("Show leave and join events:")
|
||||
checked: Config.showLeaveJoinEvent
|
||||
onToggled: Config.showLeaveJoinEvent = checked
|
||||
}
|
||||
QQC2.RadioButton {
|
||||
Kirigami.FormData.label: i18n("Rooms and private chats:")
|
||||
text: i18n("Separated")
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
#include <events/roomavatarevent.h>
|
||||
#include <events/roommemberevent.h>
|
||||
#include <events/simplestateevents.h>
|
||||
#include <settings.h>
|
||||
#include <user.h>
|
||||
#include "neochatconfig.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QTimeZone>
|
||||
@@ -373,7 +373,7 @@ QVariant MessageEventModel::data(const QModelIndex &idx, int role) const
|
||||
|
||||
auto *memberEvent = timelineIt->viewAs<RoomMemberEvent>();
|
||||
if (memberEvent) {
|
||||
if ((memberEvent->isJoin() || memberEvent->isLeave()) && !Settings().value("UI/show_joinleave", true).toBool())
|
||||
if ((memberEvent->isJoin() || memberEvent->isLeave()) && !NeoChatConfig::self()->showLeaveJoinEvent())
|
||||
return EventStatus::Hidden;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,10 @@
|
||||
<label>Merge Room Lists</label>
|
||||
<default>false</default>
|
||||
</entry>
|
||||
<entry name="ShowLeaveJoinEvent" type="bool">
|
||||
<label>Show leave and join events in the timeline</label>
|
||||
<default>true</default>
|
||||
</entry>
|
||||
</group>
|
||||
</kcfg>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user