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
91155bf8
Commit
91155bf8
authored
4 years ago
by
Loren Burkholder
Browse files
Options
Downloads
Patches
Plain Diff
Add commands to override Markdown setting
parent
f47bedff
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
src/timeline/InputBar.cpp
+6
-2
6 additions, 2 deletions
src/timeline/InputBar.cpp
src/timeline/InputBar.h
+8
-1
8 additions, 1 deletion
src/timeline/InputBar.h
with
14 additions
and
3 deletions
src/timeline/InputBar.cpp
+
6
−
2
View file @
91155bf8
...
...
@@ -251,12 +251,12 @@ InputBar::openFileSelection()
}
void
InputBar
::
message
(
QString
msg
)
InputBar
::
message
(
QString
msg
,
MarkdownOverride
useMarkdown
)
{
mtx
::
events
::
msg
::
Text
text
=
{};
text
.
body
=
msg
.
trimmed
().
toStdString
();
if
(
ChatPage
::
instance
()
->
userSettings
()
->
markdown
())
{
if
(
(
ChatPage
::
instance
()
->
userSettings
()
->
markdown
()
&&
(
useMarkdown
!=
MarkdownOverride
::
OFF
))
||
(
useMarkdown
==
MarkdownOverride
::
ON
)
)
{
text
.
formatted_body
=
utils
::
markdownToHtml
(
msg
).
toStdString
();
// Don't send formatted_body, when we don't need to
...
...
@@ -477,6 +477,10 @@ InputBar::command(QString command, QString args)
room
->
clearTimeline
();
}
else
if
(
command
==
"rotate-megolm-session"
)
{
cache
::
dropOutboundMegolmSession
(
room
->
roomId
().
toStdString
());
}
else
if
(
command
==
"md"
)
{
message
(
args
,
MarkdownOverride
::
ON
);
}
else
if
(
command
==
"plain"
)
{
message
(
args
,
MarkdownOverride
::
OFF
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/timeline/InputBar.h
+
8
−
1
View file @
91155bf8
...
...
@@ -12,6 +12,13 @@ class QMimeData;
class
QDropEvent
;
class
QStringList
;
enum
class
MarkdownOverride
{
NONE
,
// no override set
ON
,
OFF
,
};
class
InputBar
:
public
QObject
{
Q_OBJECT
...
...
@@ -41,7 +48,7 @@ public slots:
void
updateState
(
int
selectionStart
,
int
selectionEnd
,
int
cursorPosition
,
QString
text
);
void
openFileSelection
();
bool
uploading
()
const
{
return
uploading_
;
}
void
message
(
QString
body
);
void
message
(
QString
body
,
MarkdownOverride
useMarkdown
=
MarkdownOverride
::
NONE
);
QObject
*
completerFor
(
QString
completerName
);
...
...
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