Skip to content

Commit

Permalink
fix: revert federation filed from proto message to ensure back-compat…
Browse files Browse the repository at this point in the history
…ibility
  • Loading branch information
sameh-farouk committed Sep 25, 2023
1 parent ebeb5cd commit f7605fd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion proto/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ message Ping {}
message Pong {}

message Envelope {
reserved 11;
// uid is auto generated by rmb.
string uid = 1;
// client specific tags
Expand All @@ -62,6 +61,9 @@ message Envelope {
// schema of the payload of either the request or the resposne message.
optional string schema = 10;

// a federation url (domain)
// this filed ignored by relays but left for back compatibilty with old peers
optional string federation = 11;

// pyload of the message is interpreted differently based
// on the message filed
Expand Down
4 changes: 4 additions & 0 deletions src/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,10 @@ impl Challengeable for Envelope {
write!(hash, "{}", schema)?;
}

if let Some(ref federation) = self.federation {
write!(hash, "{}", federation)?;
}

match self.payload {
None => {}
Some(types::envelope::Payload::Plain(ref data)) => {
Expand Down

0 comments on commit f7605fd

Please sign in to comment.