Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nheko
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nheko Reborn
nheko
Commits
6c7e6b0e
Commit
6c7e6b0e
authored
5 years ago
by
Nicolas Werner
Browse files
Options
Downloads
Patches
Plain Diff
Fix read indicator
parent
d34067a2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
resources/qml/StatusIndicator.qml
+2
-2
2 additions, 2 deletions
resources/qml/StatusIndicator.qml
src/timeline2/TimelineModel.cpp
+13
-2
13 additions, 2 deletions
src/timeline2/TimelineModel.cpp
with
15 additions
and
4 deletions
resources/qml/StatusIndicator.qml
+
2
−
2
View file @
6c7e6b0e
...
...
@@ -9,13 +9,13 @@ Rectangle {
color
:
"
transparent
"
width
:
16
height
:
16
ToolTip.visible
:
ma
.
containsMouse
ToolTip.visible
:
ma
.
containsMouse
&&
state
!=
MtxEvent
.
Empty
ToolTip.text
:
switch
(
state
)
{
case
MtxEvent.Failed
:
return
qsTr
(
"
Failed
"
)
case
MtxEvent.Sent
:
return
qsTr
(
"
Sent
"
)
case
MtxEvent.Received
:
return
qsTr
(
"
Received
"
)
case
MtxEvent.Read
:
return
qsTr
(
"
Read
"
)
default
:
return
qsTr
(
"
Empty
"
)
default
:
return
""
}
MouseArea
{
id
:
ma
...
...
This diff is collapsed.
Click to expand it.
src/timeline2/TimelineModel.cpp
+
13
−
2
View file @
6c7e6b0e
...
...
@@ -268,6 +268,10 @@ TimelineModel::TimelineModel(QString room_id, QObject *parent)
ev
);
events
.
remove
(
txn_id
);
events
.
insert
(
event_id
,
ev
);
// ask to be notified for read receipts
cache
::
client
()
->
addPendingReceipt
(
room_id_
,
event_id
);
emit
dataChanged
(
index
(
idx
,
0
),
index
(
idx
,
0
));
});
}
...
...
@@ -373,11 +377,17 @@ TimelineModel::data(const QModelIndex &index, int role) const
case
Id
:
return
id
;
case
State
:
if
(
failed
.
contains
(
id
))
// only show read receipts for messages not from us
if
(
boost
::
apply_visitor
([](
const
auto
&
e
)
->
QString
{
return
senderId
(
e
);
},
event
)
.
toStdString
()
!=
http
::
client
()
->
user_id
().
to_string
())
return
qml_mtx_events
::
Empty
;
else
if
(
failed
.
contains
(
id
))
return
qml_mtx_events
::
Failed
;
else
if
(
pending
.
contains
(
id
))
return
qml_mtx_events
::
Sent
;
else
if
(
read
.
contains
(
id
))
else
if
(
read
.
contains
(
id
)
||
cache
::
client
()
->
readReceipts
(
id
,
room_id_
).
size
()
>
1
)
return
qml_mtx_events
::
Read
;
else
return
qml_mtx_events
::
Received
;
...
...
@@ -695,6 +705,7 @@ TimelineModel::indexToId(int index) const
return
eventOrder
[
index
];
}
// Note: this will only be called for our messages
void
TimelineModel
::
markEventsAsRead
(
const
std
::
vector
<
QString
>
&
event_ids
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment