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
9d6bc706
Verified
Commit
9d6bc706
authored
3 years ago
by
Nicolas Werner
Browse files
Options
Downloads
Patches
Plain Diff
Don't use full dump for replies
parent
f704e381
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#1365
failed
3 years ago
Stage: build
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
resources/qml/TimelineRow.qml
+22
-20
22 additions, 20 deletions
resources/qml/TimelineRow.qml
src/timeline/TimelineModel.h
+5
-0
5 additions, 0 deletions
src/timeline/TimelineModel.h
src/timeline/TimelineViewManager.cpp
+2
-0
2 additions, 0 deletions
src/timeline/TimelineViewManager.cpp
with
29 additions
and
20 deletions
resources/qml/TimelineRow.qml
+
22
−
20
View file @
9d6bc706
...
...
@@ -71,8 +71,6 @@ Item {
RowLayout
{
id
:
row
property
var
replyData
:
chat
.
model
.
getDump
(
replyTo
,
eventId
)
anchors.rightMargin
:
1
anchors.leftMargin
:
Nheko
.
avatarSize
+
16
anchors.left
:
parent
.
left
...
...
@@ -87,26 +85,30 @@ Item {
// fancy reply, if this is a reply
Reply
{
function
fromModel
(
role
)
{
return
replyTo
!=
""
?
room
.
dataById
(
replyTo
,
role
)
:
null
;
}
visible
:
replyTo
userColor
:
TimelineManager
.
userColor
(
userId
,
Nheko
.
colors
.
base
)
blurhash
:
ro
w
.
replyData
.
b
lurhash
??
""
body
:
ro
w
.
replyData
.
b
ody
??
""
formattedBody
:
ro
w
.
replyData
.
f
ormattedBody
??
""
eventId
:
ro
w
.
replyData
.
e
ventId
??
""
filename
:
ro
w
.
replyData
.
f
ilename
??
""
filesize
:
ro
w
.
replyData
.
f
ilesize
??
""
proportionalHeight
:
ro
w
.
replyData
.
p
roportionalHeight
??
1
type
:
ro
w
.
replyData
.
t
ype
??
MtxEvent
.
UnknownMessage
typeString
:
ro
w
.
replyData
.
t
ypeString
??
""
url
:
ro
w
.
replyData
.
u
rl
??
""
originalWidth
:
ro
w
.
replyData
.
o
riginalWidth
??
0
isOnlyEmoji
:
ro
w
.
replyData
.
i
sOnlyEmoji
??
false
userId
:
ro
w
.
replyData
.
u
serId
??
""
userName
:
ro
w
.
replyData
.
u
serName
??
""
thumbnailUrl
:
ro
w
.
replyData
.
t
humbnailUrl
??
""
roomTopic
:
ro
w
.
replyData
.
r
oomTopic
??
""
roomName
:
ro
w
.
replyData
.
r
oomName
??
""
callType
:
ro
w
.
replyData
.
c
allType
??
""
blurhash
:
f
ro
mModel
(
Room
.
B
lurhash
)
??
""
body
:
f
ro
mModel
(
Room
.
B
ody
)
??
""
formattedBody
:
f
ro
mModel
(
Room
.
F
ormattedBody
)
??
""
eventId
:
f
ro
mModel
(
Room
.
E
ventId
)
??
""
filename
:
f
ro
mModel
(
Room
.
F
ilename
)
??
""
filesize
:
f
ro
mModel
(
Room
.
F
ilesize
)
??
""
proportionalHeight
:
f
ro
mModel
(
Room
.
P
roportionalHeight
)
??
1
type
:
f
ro
mModel
(
Room
.
T
ype
)
??
MtxEvent
.
UnknownMessage
typeString
:
f
ro
mModel
(
Room
.
T
ypeString
)
??
""
url
:
f
ro
mModel
(
Room
.
U
rl
)
??
""
originalWidth
:
f
ro
mModel
(
Room
.
O
riginalWidth
)
??
0
isOnlyEmoji
:
f
ro
mModel
(
Room
.
I
sOnlyEmoji
)
??
false
userId
:
f
ro
mModel
(
Room
.
U
serId
)
??
""
userName
:
f
ro
mModel
(
Room
.
U
serName
)
??
""
thumbnailUrl
:
f
ro
mModel
(
Room
.
T
humbnailUrl
)
??
""
roomTopic
:
f
ro
mModel
(
Room
.
R
oomTopic
)
??
""
roomName
:
f
ro
mModel
(
Room
.
R
oomName
)
??
""
callType
:
f
ro
mModel
(
Room
.
C
allType
)
??
""
}
// actual message content
...
...
This diff is collapsed.
Click to expand it.
src/timeline/TimelineModel.h
+
5
−
0
View file @
9d6bc706
...
...
@@ -209,11 +209,16 @@ public:
CallType
,
Dump
,
};
Q_ENUM
(
Roles
);
QHash
<
int
,
QByteArray
>
roleNames
()
const
override
;
int
rowCount
(
const
QModelIndex
&
parent
=
QModelIndex
())
const
override
;
QVariant
data
(
const
QModelIndex
&
index
,
int
role
=
Qt
::
DisplayRole
)
const
override
;
QVariant
data
(
const
mtx
::
events
::
collections
::
TimelineEvents
&
event
,
int
role
)
const
;
Q_INVOKABLE
QVariant
dataById
(
QString
id
,
int
role
)
{
return
data
(
index
(
idToIndex
(
id
)),
role
);
}
bool
canFetchMore
(
const
QModelIndex
&
)
const
override
;
void
fetchMore
(
const
QModelIndex
&
)
override
;
...
...
This diff is collapsed.
Click to expand it.
src/timeline/TimelineViewManager.cpp
+
2
−
0
View file @
9d6bc706
...
...
@@ -178,6 +178,8 @@ TimelineViewManager::TimelineViewManager(CallManager *callManager, ChatPage *par
0
,
"RoomSettingsModel"
,
"Room Settings needs to be instantiated on the C++ side"
);
qmlRegisterUncreatableType
<
TimelineModel
>
(
"im.nheko"
,
1
,
0
,
"Room"
,
"Room needs to be instantiated on the C++ side"
);
static
auto
self
=
this
;
qmlRegisterSingletonType
<
MainWindow
>
(
...
...
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