Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Konheko
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
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
Konheko
Commits
365efaa5
Commit
365efaa5
authored
5 years ago
by
Nicolas Werner
Browse files
Options
Downloads
Patches
Plain Diff
Synchronize setting unread notifications
parent
a1d0cc12
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gdb_history
+1
-0
1 addition, 0 deletions
.gdb_history
src/models/roommodel.cpp
+1
-0
1 addition, 0 deletions
src/models/roommodel.cpp
src/models/roommodel.h
+3
-0
3 additions, 0 deletions
src/models/roommodel.h
src/sync.cpp
+1
-1
1 addition, 1 deletion
src/sync.cpp
with
6 additions
and
1 deletion
.gdb_history
0 → 100644
+
1
−
0
View file @
365efaa5
exit
This diff is collapsed.
Click to expand it.
src/models/roommodel.cpp
+
1
−
0
View file @
365efaa5
...
...
@@ -140,6 +140,7 @@ Room::Room(QObject *parent) {
Q_UNUSED
(
parent
);
connect
(
this
,
&
Room
::
newEvents
,
this
,
&
Room
::
addEvents
,
Qt
::
QueuedConnection
);
connect
(
this
,
&
Room
::
newTags
,
this
,
&
Room
::
setTags
,
Qt
::
QueuedConnection
);
connect
(
this
,
&
Room
::
newUnreadState
,
this
,
&
Room
::
setUnread
,
Qt
::
QueuedConnection
);
this
->
moveToThread
(
QGuiApplication
::
instance
()
->
thread
());
}
...
...
This diff is collapsed.
Click to expand it.
src/models/roommodel.h
+
3
−
0
View file @
365efaa5
...
...
@@ -140,18 +140,21 @@ struct Room : public QAbstractListModel {
emit
newEvents
(
events
,
prev_batch
,
next_batch
);
}
void
applyTags
(
const
std
::
vector
<
std
::
string
>
&
tags
)
{
emit
setTags
(
tags
);
}
void
applyUnreadNotifications
(
int
unread
)
{
emit
newUnreadState
(
unread
);
}
std
::
string
name
();
signals
:
void
newEvents
(
std
::
vector
<
mtx
::
events
::
collections
::
TimelineEvents
>
events
,
std
::
string
prev_batch
,
std
::
string
next_batch
);
void
newTags
(
std
::
vector
<
std
::
string
>
tags
);
void
newUnreadState
(
int
);
void
roomNameChanged
(
QString
name
);
public
slots
:
void
addEvents
(
std
::
vector
<
mtx
::
events
::
collections
::
TimelineEvents
>
events
,
std
::
string
prev_batch
,
std
::
string
next_batch
);
void
setTags
(
std
::
vector
<
std
::
string
>
tags
)
{
this
->
tags
=
tags
;
}
void
setUnread
(
int
unread
)
{
this
->
unreadNotifications
=
unread
;
}
void
fetchOlderMessages
();
void
sendTextMessage
(
QString
message
);
...
...
This diff is collapsed.
Click to expand it.
src/sync.cpp
+
1
−
1
View file @
365efaa5
...
...
@@ -137,8 +137,8 @@ void Sync::sync() {
}
room
->
applyTags
(
tags
);
room
->
applyEvents
(
timeline
,
r
.
timeline
.
prev_batch
,
res
.
next_batch
);
room
->
applyUnreadNotifications
(
r
.
unread_notifications
.
notification_count
);
room
->
unreadNotifications
=
r
.
unread_notifications
.
notification_count
;
if
(
createRoom
)
emit
newRoom
(
room
);
else
...
...
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