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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nheko Reborn
nheko
Commits
7aca8a94
Commit
7aca8a94
authored
Sep 8, 2019
by
Nicolas Werner
Browse files
Options
Downloads
Patches
Plain Diff
Reenable view raw message
parent
86f4119a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
resources/qml/TimelineView.qml
+1
-2
1 addition, 2 deletions
resources/qml/TimelineView.qml
src/timeline2/TimelineModel.cpp
+12
-1
12 additions, 1 deletion
src/timeline2/TimelineModel.cpp
src/timeline2/TimelineModel.h
+2
-0
2 additions, 0 deletions
src/timeline2/TimelineModel.h
with
15 additions
and
3 deletions
resources/qml/TimelineView.qml
+
1
−
2
View file @
7aca8a94
...
@@ -42,11 +42,9 @@ Rectangle {
...
@@ -42,11 +42,9 @@ Rectangle {
anchors.left
:
parent
.
left
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
anchors.right
:
parent
.
right
anchors.rightMargin
:
scrollbar
.
width
anchors.rightMargin
:
scrollbar
.
width
height
:
loader
.
height
Loader
{
Loader
{
id
:
loader
id
:
loader
asynchronous
:
false
Layout.fillWidth
:
true
Layout.fillWidth
:
true
Layout.alignment
:
Qt
.
AlignTop
Layout.alignment
:
Qt
.
AlignTop
height
:
item
.
height
height
:
item
.
height
...
@@ -135,6 +133,7 @@ Rectangle {
...
@@ -135,6 +133,7 @@ Rectangle {
}
}
MenuItem
{
MenuItem
{
text
:
"
View raw message
"
text
:
"
View raw message
"
onTriggered
:
chat
.
model
.
viewRawMessage
(
model
.
id
)
}
}
MenuItem
{
MenuItem
{
text
:
"
Redact message
"
text
:
"
Redact message
"
...
...
This diff is collapsed.
Click to expand it.
src/timeline2/TimelineModel.cpp
+
12
−
1
View file @
7aca8a94
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
#include
"Logging.h"
#include
"Logging.h"
#include
"Utils.h"
#include
"Utils.h"
#include
"dialogs/RawMessage.h"
namespace
{
namespace
{
template
<
class
T
>
template
<
class
T
>
...
@@ -220,6 +221,7 @@ TimelineModel::roleNames() const
...
@@ -220,6 +221,7 @@ TimelineModel::roleNames() const
{
Height
,
"height"
},
{
Height
,
"height"
},
{
Width
,
"width"
},
{
Width
,
"width"
},
{
ProportionalHeight
,
"proportionalHeight"
},
{
ProportionalHeight
,
"proportionalHeight"
},
{
Id
,
"id"
},
};
};
}
}
int
int
...
@@ -293,7 +295,8 @@ TimelineModel::data(const QModelIndex &index, int role) const
...
@@ -293,7 +295,8 @@ TimelineModel::data(const QModelIndex &index, int role) const
case
ProportionalHeight
:
case
ProportionalHeight
:
return
QVariant
(
boost
::
apply_visitor
(
return
QVariant
(
boost
::
apply_visitor
(
[](
const
auto
&
e
)
->
double
{
return
eventPropHeight
(
e
);
},
events
.
value
(
id
)));
[](
const
auto
&
e
)
->
double
{
return
eventPropHeight
(
e
);
},
events
.
value
(
id
)));
case
Id
:
return
id
;
default
:
default
:
return
QVariant
();
return
QVariant
();
}
}
...
@@ -417,3 +420,11 @@ TimelineModel::escapeEmoji(QString str) const
...
@@ -417,3 +420,11 @@ TimelineModel::escapeEmoji(QString str) const
{
{
return
utils
::
replaceEmoji
(
str
);
return
utils
::
replaceEmoji
(
str
);
}
}
void
TimelineModel
::
viewRawMessage
(
QString
id
)
const
{
std
::
string
ev
=
utils
::
serialize_event
(
events
.
value
(
id
)).
dump
(
4
);
auto
dialog
=
new
dialogs
::
RawMessage
(
QString
::
fromStdString
(
ev
));
Q_UNUSED
(
dialog
);
}
This diff is collapsed.
Click to expand it.
src/timeline2/TimelineModel.h
+
2
−
0
View file @
7aca8a94
...
@@ -86,6 +86,7 @@ public:
...
@@ -86,6 +86,7 @@ public:
Height
,
Height
,
Width
,
Width
,
ProportionalHeight
,
ProportionalHeight
,
Id
,
};
};
QHash
<
int
,
QByteArray
>
roleNames
()
const
override
;
QHash
<
int
,
QByteArray
>
roleNames
()
const
override
;
...
@@ -97,6 +98,7 @@ public:
...
@@ -97,6 +98,7 @@ public:
Q_INVOKABLE
QString
avatarUrl
(
QString
id
)
const
;
Q_INVOKABLE
QString
avatarUrl
(
QString
id
)
const
;
Q_INVOKABLE
QString
formatDateSeparator
(
QDate
date
)
const
;
Q_INVOKABLE
QString
formatDateSeparator
(
QDate
date
)
const
;
Q_INVOKABLE
QString
escapeEmoji
(
QString
str
)
const
;
Q_INVOKABLE
QString
escapeEmoji
(
QString
str
)
const
;
Q_INVOKABLE
void
viewRawMessage
(
QString
id
)
const
;
void
addEvents
(
const
mtx
::
responses
::
Timeline
&
events
);
void
addEvents
(
const
mtx
::
responses
::
Timeline
&
events
);
...
...
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
sign in
to comment