Compare commits
1 Commits
work/dphal
...
work/amazi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7e3e0b9b96 |
@@ -49,6 +49,9 @@
|
||||
<entry name="TypingNotifications" type="bool">
|
||||
<default>true</default>
|
||||
</entry>
|
||||
<entry name="PublicReadReceipts" type="bool">
|
||||
<default>true</default>
|
||||
</entry>
|
||||
<entry name="AutoRoomInfoDrawer" type="bool">
|
||||
<label>Automatic Hide/Unhide Room Information</label>
|
||||
<default>true</default>
|
||||
@@ -227,4 +230,3 @@
|
||||
</entry>
|
||||
</group>
|
||||
</kcfg>
|
||||
|
||||
|
||||
@@ -1935,13 +1935,23 @@ bool NeoChatRoom::spaceHasUnreadMessages() const
|
||||
return SpaceHierarchyCache::instance().spaceHasUnreadMessages(id());
|
||||
}
|
||||
|
||||
void NeoChatRoom::markAllChildrenMessagesAsRead()
|
||||
void NeoChatRoom::markAllChildrenMessagesAsRead(bool sendPublicReceipts)
|
||||
{
|
||||
if (isSpace()) {
|
||||
SpaceHierarchyCache::instance().markAllChildrenMessagesAsRead(id());
|
||||
SpaceHierarchyCache::instance().markAllChildrenMessagesAsRead(id(), sendPublicReceipts);
|
||||
}
|
||||
}
|
||||
|
||||
void NeoChatRoom::markAllMessagesAsRead(bool sendPublicReceipts)
|
||||
{
|
||||
#if Quotient_VERSION_MINOR >= 10
|
||||
Room::markAllMessagesAsRead(sendPublicReceipts);
|
||||
#else
|
||||
Q_UNUSED(sendPublicReceipts)
|
||||
Room::markAllMessagesAsRead();
|
||||
#endif
|
||||
}
|
||||
|
||||
QList<QString> NeoChatRoom::sortedMemberIds() const
|
||||
{
|
||||
return m_sortedMemberIds;
|
||||
|
||||
@@ -679,7 +679,12 @@ public:
|
||||
/**
|
||||
* @brief Mark the space and all its children messages as read.
|
||||
*/
|
||||
Q_INVOKABLE void markAllChildrenMessagesAsRead();
|
||||
Q_INVOKABLE void markAllChildrenMessagesAsRead(bool sendPublicReceipts);
|
||||
|
||||
/**
|
||||
* @brief Mark all messages in the room as read up to the latest event.
|
||||
*/
|
||||
Q_INVOKABLE void markAllMessagesAsRead(bool sendPublicReceipts = true);
|
||||
|
||||
/**
|
||||
* @return List of members in this room, sorted by power level and then by name.
|
||||
|
||||
@@ -254,7 +254,7 @@ void SpaceHierarchyCache::setRecommendedSpaceHidden(bool hidden)
|
||||
Q_EMIT recommendedSpaceHiddenChanged();
|
||||
}
|
||||
|
||||
void SpaceHierarchyCache::markAllChildrenMessagesAsRead(const QString &spaceId)
|
||||
void SpaceHierarchyCache::markAllChildrenMessagesAsRead(const QString &spaceId, bool sendPublicReceipts)
|
||||
{
|
||||
const auto children = m_spaceHierarchy[spaceId];
|
||||
|
||||
@@ -277,14 +277,14 @@ void SpaceHierarchyCache::markAllChildrenMessagesAsRead(const QString &spaceId)
|
||||
child,
|
||||
&NeoChatRoom::addedMessages,
|
||||
child,
|
||||
[child] {
|
||||
[child, sendPublicReceipts] {
|
||||
if (child->messageEvents().crbegin() != child->historyEdge()) {
|
||||
child->markAllMessagesAsRead();
|
||||
child->markAllMessagesAsRead(sendPublicReceipts);
|
||||
}
|
||||
},
|
||||
Qt::SingleShotConnection);
|
||||
} else {
|
||||
child->markAllMessagesAsRead();
|
||||
child->markAllMessagesAsRead(sendPublicReceipts);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ public:
|
||||
bool recommendedSpaceHidden() const;
|
||||
void setRecommendedSpaceHidden(bool hidden);
|
||||
|
||||
void markAllChildrenMessagesAsRead(const QString &spaceId);
|
||||
void markAllChildrenMessagesAsRead(const QString &spaceId, bool sendPublicReceipts);
|
||||
|
||||
Q_SIGNALS:
|
||||
void spaceHierarchyChanged();
|
||||
|
||||
@@ -47,7 +47,7 @@ KirigamiComponents.ConvergentContextMenu {
|
||||
text: i18nc("@action:inmenu", "Mark as Read")
|
||||
icon.name: "checkmark"
|
||||
enabled: root.room.notificationCount > 0 || root.room.highlightCount > 0
|
||||
onTriggered: root.room.markAllMessagesAsRead()
|
||||
onTriggered: root.room.markAllMessagesAsRead(NeoChatConfig.publicReadReceipts)
|
||||
}
|
||||
|
||||
Kirigami.Action {
|
||||
|
||||
@@ -45,7 +45,7 @@ KirigamiComponents.ConvergentContextMenu {
|
||||
icon.name: "checkmark"
|
||||
enabled: root.room.spaceHasUnreadMessages
|
||||
onTriggered: {
|
||||
root.room.markAllChildrenMessagesAsRead();
|
||||
root.room.markAllChildrenMessagesAsRead(NeoChatConfig.publicReadReceipts);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -67,8 +67,18 @@ FormCard.FormCardPage {
|
||||
NeoChatConfig.save();
|
||||
}
|
||||
}
|
||||
FormCard.FormCheckDelegate {
|
||||
id: publicReceiptsDelegate
|
||||
text: i18nc("@option:check", "Send read receipts")
|
||||
checked: NeoChatConfig.publicReadReceipts
|
||||
enabled: !NeoChatConfig.isPublicReadReceiptsImmutable
|
||||
onToggled: {
|
||||
NeoChatConfig.publicReadReceipts = checked;
|
||||
NeoChatConfig.save();
|
||||
}
|
||||
}
|
||||
FormCard.FormDelegateSeparator {
|
||||
above: typingNotificationsDelegate
|
||||
above: publicReceiptsDelegate
|
||||
below: hideImagesDelegate
|
||||
}
|
||||
FormCard.FormCheckDelegate {
|
||||
|
||||
@@ -73,7 +73,7 @@ TimelineDelegate {
|
||||
text: i18nc("@action:button Mark all messages up to now as read", "Mark as Read")
|
||||
icon.name: "checkmark"
|
||||
|
||||
onClicked: root.room.markAllMessagesAsRead()
|
||||
onClicked: root.room.markAllMessagesAsRead(NeoChatConfig.publicReadReceipts)
|
||||
|
||||
Layout.alignment: Qt.AlignRight
|
||||
}
|
||||
|
||||
@@ -170,26 +170,26 @@ QQC2.ScrollView {
|
||||
|
||||
function onReadMarkerAdded() {
|
||||
if (root.markReadCondition == LibNeoChat.TimelineMarkReadCondition.EntryVisible && messageListView.allUnreadVisible()) {
|
||||
_private.room.markAllMessagesAsRead();
|
||||
_private.room.markAllMessagesAsRead(NeoChatConfig.publicReadReceipts);
|
||||
}
|
||||
}
|
||||
|
||||
function onNewLocalUserEventAdded() {
|
||||
messageListView.positionViewAtBeginning();
|
||||
_private.room.markAllMessagesAsRead();
|
||||
_private.room.markAllMessagesAsRead(NeoChatConfig.publicReadReceipts);
|
||||
}
|
||||
|
||||
function onRoomAboutToChange(oldRoom, newRoom) {
|
||||
if (root.markReadCondition == LibNeoChat.TimelineMarkReadCondition.Exit ||
|
||||
(root.markReadCondition == LibNeoChat.TimelineMarkReadCondition.ExitVisible && messageListView.allUnreadVisible())
|
||||
) {
|
||||
oldRoom.markAllMessagesAsRead();
|
||||
oldRoom.markAllMessagesAsRead(NeoChatConfig.publicReadReceipts);
|
||||
}
|
||||
}
|
||||
|
||||
function onRoomChanged(oldRoom, newRoom) {
|
||||
if (root.markReadCondition == LibNeoChat.TimelineMarkReadCondition.Entry) {
|
||||
newRoom.markAllMessagesAsRead();
|
||||
newRoom.markAllMessagesAsRead(NeoChatConfig.publicReadReceipts);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -202,7 +202,7 @@ QQC2.ScrollView {
|
||||
|
||||
if (closeToYEnd && _private.hasScrolledUpBefore) {
|
||||
if (QQC2.ApplicationWindow.window && (QQC2.ApplicationWindow.window.visibility !== QQC2.ApplicationWindow.Hidden)) {
|
||||
_private.room.markAllMessagesAsRead();
|
||||
_private.room.markAllMessagesAsRead(NeoChatConfig.publicReadReceipts);
|
||||
}
|
||||
_private.hasScrolledUpBefore = false;
|
||||
} else if (!closeToYEnd) {
|
||||
@@ -298,7 +298,7 @@ QQC2.ScrollView {
|
||||
|
||||
onClicked: {
|
||||
messageListView.positionViewAtBeginning();
|
||||
_private.room.markAllMessagesAsRead();
|
||||
_private.room.markAllMessagesAsRead(NeoChatConfig.publicReadReceipts);
|
||||
}
|
||||
|
||||
icon.name: "go-down"
|
||||
|
||||
Reference in New Issue
Block a user