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
5a5aba66
Commit
5a5aba66
authored
3 years ago
by
targetakhil
Browse files
Options
Downloads
Patches
Plain Diff
make util strip util functions non-static and move definition to cpp file
parent
2dfa40e0
No related branches found
No related tags found
No related merge requests found
Pipeline
#1000
failed
3 years ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Utils.cpp
+18
-0
18 additions, 0 deletions
src/Utils.cpp
src/Utils.h
+4
-16
4 additions, 16 deletions
src/Utils.h
with
22 additions
and
16 deletions
src/Utils.cpp
+
18
−
0
View file @
5a5aba66
...
...
@@ -52,6 +52,24 @@ createDescriptionInfo(const Event &event, const QString &localUser, const QStrin
ts
};
}
void
utils
::
stripReplyFromBody
(
QString
&
body
)
{
QRegularExpression
plainQuote
(
"^>.*?$
\n
?"
,
QRegularExpression
::
MultilineOption
);
while
(
body
.
startsWith
(
">"
))
body
.
remove
(
plainQuote
);
if
(
body
.
startsWith
(
"
\n
"
))
body
.
remove
(
0
,
1
);
}
void
utils
::
stripReplyFromFormattedBody
(
QString
&
formatted_body
)
{
formatted_body
.
remove
(
QRegularExpression
(
"<mx-reply>.*</mx-reply>"
,
QRegularExpression
::
DotMatchesEverythingOption
));
formatted_body
.
replace
(
"@room"
,
"@\u2060aroom"
);
}
RelatedInfo
utils
::
stripReplyFallbacks
(
const
TimelineEvent
&
event
,
std
::
string
id
,
QString
room_id_
)
{
...
...
This diff is collapsed.
Click to expand it.
src/Utils.h
+
4
−
16
View file @
5a5aba66
...
...
@@ -42,24 +42,12 @@ namespace utils {
using
TimelineEvent
=
mtx
::
events
::
collections
::
TimelineEvents
;
//! Helper function to remove reply fallback from body
static
void
stripReplyFromBody
(
QString
&
body
)
{
QRegularExpression
plainQuote
(
"^>.*?$
\n
?"
,
QRegularExpression
::
MultilineOption
);
while
(
body
.
startsWith
(
">"
))
body
.
remove
(
plainQuote
);
if
(
body
.
startsWith
(
"
\n
"
))
body
.
remove
(
0
,
1
);
}
void
stripReplyFromBody
(
QString
&
body
);
//! Helper function to remove reply fallback from formatted body
static
void
stripReplyFromFormattedBody
(
QString
&
formatted_body
)
{
formatted_body
.
remove
(
QRegularExpression
(
"<mx-reply>.*</mx-reply>"
,
QRegularExpression
::
DotMatchesEverythingOption
));
formatted_body
.
replace
(
"@room"
,
"@\u2060aroom"
);
}
void
stripReplyFromFormattedBody
(
QString
&
formatted_body
);
RelatedInfo
stripReplyFallbacks
(
const
TimelineEvent
&
event
,
std
::
string
id
,
QString
room_id_
);
...
...
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