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
1bf614b0
Unverified
Commit
1bf614b0
authored
4 years ago
by
Timo Kösters
Browse files
Options
Downloads
Patches
Plain Diff
fix: remove transaction_id from pdus over federation
parent
b7ab5789
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/database/sending.rs
+6
-0
6 additions, 0 deletions
src/database/sending.rs
src/pdu.rs
+4
-1
4 additions, 1 deletion
src/pdu.rs
with
10 additions
and
1 deletion
src/database/sending.rs
+
6
−
0
View file @
1bf614b0
...
...
@@ -36,6 +36,12 @@ pub fn start_handler(&self, globals: &super::globals::Globals, rooms: &super::ro
let
pdu_id
=
parts
.next
()
.ok_or_else
(||
Error
::
bad_database
(
"Invalid serverpduid in db."
))
?
;
let
mut
pdu_json
=
rooms
.get_pdu_json_from_id
(
&
pdu_id
.into
())
?
.ok_or_else
(||
Error
::
bad_database
(
"Event in serverpduids not found in db."
))
?
;
if
let
Some
(
unsigned
)
=
pdu_json
.as_object_mut
()
.expect
(
"json is object"
)
.get_mut
(
"unsigned"
)
{
unsigned
.as_object_mut
()
.expect
(
"unsigned is object"
)
.remove
(
"transaction_id"
);
}
pdu_json
.as_object_mut
()
.expect
(
"json is object"
)
...
...
This diff is collapsed.
Click to expand it.
src/pdu.rs
+
4
−
1
View file @
1bf614b0
...
...
@@ -201,6 +201,9 @@ pub fn to_member_event(&self) -> Raw<StateEvent<MemberEventContent>> {
}
pub
fn
to_outgoing_federation_event
(
&
self
)
->
Raw
<
PduStub
>
{
let
mut
unsigned
=
self
.unsigned
.clone
();
unsigned
.remove
(
"transaction_id"
);
let
mut
json
=
json!
({
"room_id"
:
self
.room_id
,
"sender"
:
self
.sender
,
...
...
@@ -210,7 +213,7 @@ pub fn to_outgoing_federation_event(&self) -> Raw<PduStub> {
"prev_events"
:
self
.prev_events
,
"depth"
:
self
.depth
,
"auth_events"
:
self
.auth_events
,
"unsigned"
:
self
.
unsigned
,
"unsigned"
:
unsigned
,
"hashes"
:
self
.hashes
,
"signatures"
:
self
.signatures
,
});
...
...
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