Skip to content

Commit

Permalink
Add an equality operator for PublicMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
bifurcation committed Sep 5, 2023
1 parent 949c447 commit 78d5957
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/mls/messages.h
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,7 @@ struct PublicMessage

friend tls::ostream& operator<<(tls::ostream& str, const PublicMessage& obj);
friend tls::istream& operator>>(tls::istream& str, PublicMessage& obj);
friend bool operator==(const PublicMessage& lhs, const PublicMessage& rhs);

private:
GroupContent content;
Expand Down
8 changes: 8 additions & 0 deletions src/messages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,14 @@ operator>>(tls::istream& str, PublicMessage& obj)
return str;
}

bool
operator==(const PublicMessage& lhs, const PublicMessage& rhs)
{
return lhs.content == rhs.content &&
lhs.auth == rhs.auth &&
lhs.membership_tag == rhs.membership_tag;
}

static bytes
marshal_ciphertext_content(const GroupContent& content,
const GroupContentAuthData& auth,
Expand Down

0 comments on commit 78d5957

Please sign in to comment.