Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
conduwuit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
🥺
conduwuit
Commits
40f53455
Commit
40f53455
authored
1 year ago
by
🥺
Committed by
🥺
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
fix formatting and links of user reports more
Signed-off-by:
strawberry
<
strawberry@puppygock.gay
>
parent
6063a671
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/api/client_server/report.rs
+30
-24
30 additions, 24 deletions
src/api/client_server/report.rs
with
30 additions
and
24 deletions
src/api/client_server/report.rs
+
30
−
24
View file @
40f53455
...
@@ -72,32 +72,38 @@ pub async fn report_event_route(
...
@@ -72,32 +72,38 @@ pub async fn report_event_route(
};
};
// send admin room message that we received the report with an @room ping for urgency
// send admin room message that we received the report with an @room ping for urgency
services
()
.admin
services
()
.admin
.send_message
(
message
::
RoomMessageEventContent
::
text_html
(
.send_message
(
message
::
RoomMessageEventContent
::
text_html
(
format!
(
format!
(
"@room Report received from: {}
\n\n
\
"@room Report received from: {}
\n\n
\
Event ID: {:?}
\n
\
Event ID: {}
\n
\
Room ID: {:?}
\n
\
Room ID: {}
\n
\
Sent By: {:?}
\n\n
\
Sent By: {}
\n\n
\
Report Score: {:#?}
\n
\
Report Score: {}
\n
\
Report Reason: {:?}"
,
Report Reason: {}"
,
sender_user
.to_owned
(),
pdu
.event_id
,
pdu
.room_id
,
pdu
.sender
,
body
.score
,
body
.reason
sender_user
.to_owned
(),
),
pdu
.event_id
,
format!
(
pdu
.room_id
,
"<details><summary>@room Report received from: <a href=
\"
https://matrix.to/#/{0}
\"
>{0}
\
pdu
.sender
.to_owned
(),
</a></summary><ul><li>Event Info<ul><li>Event ID: <code>{1:?}</code>
\
body
.score
.unwrap_or
(
ruma
::
Int
::
from
(
0
)),
<a href=
\"
https://matrix.to/#/{2:?}/{1:?}
\"
>🔗</a></li><li>Room ID: <code>{2:?}</code>
\
body
.reason
.as_deref
()
.unwrap_or
(
""
)
</li><li>Sent By: <a href=
\"
https://matrix.to/#/{3:?}
\"
>{3:?}</a></li></ul></li><li>
\
),
Report Info<ul><li>Report Score: {4:?}</li><li>Report Reason: {5}</li></ul></li>
\
format!
(
"<details><summary>@room Report received from: <a href=
\"
https://matrix.to/#/{0}
\"
>{0}
\
</a></summary><ul><li>Event Info<ul><li>Event ID: <code>{1}</code>
\
<a href=
\"
https://matrix.to/#/{2}/{1}
\"
>🔗</a></li><li>Room ID: <code>{2}</code>
\
</li><li>Sent By: <a href=
\"
https://matrix.to/#/{3}
\"
>{3}</a></li></ul></li><li>
\
Report Info<ul><li>Report Score: {4}</li><li>Report Reason: {5}</li></ul></li>
\
</ul></details>"
,
</ul></details>"
,
sender_user
.to_owned
(),
sender_user
.to_owned
(),
pdu
.event_id
,
pdu
.event_id
.to_owned
()
,
pdu
.room_id
,
pdu
.room_id
.to_owned
()
,
pdu
.sender
,
pdu
.sender
.to_owned
()
,
body
.score
,
body
.score
.unwrap_or
(
ruma
::
Int
::
from
(
0
))
,
HtmlEscape
(
body
.reason
.as_deref
()
.unwrap_or
(
""
))
HtmlEscape
(
body
.reason
.as_deref
()
.unwrap_or
(
""
))
),
),
));
));
// even though this is kinda security by obscurity, let's still make a small random delay sending a successful response
// even though this is kinda security by obscurity, let's still make a small random delay sending a successful response
// per spec suggestion regarding enumerating for potential events existing in our server.
// per spec suggestion regarding enumerating for potential events existing in our server.
...
...
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