diff --git a/README.md b/README.md index 1ed1ab7..62f4f4c 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ The following MSCs are supported: * [MSC1929](https://github.com/matrix-org/matrix-spec-proposals/pull/1929) - the `/.well-known/matrix/support` endpoint * [MSC4121](https://github.com/matrix-org/matrix-spec-proposals/pull/4121) - the moderator role * [MSC4265](https://github.com/matrix-org/matrix-spec-proposals/pull/4265) - the DPO role +* [MSC4439](https://github.com/matrix-org/matrix-spec-proposals/pull/4265) - the PGP key field Initially it was developed to be used in the [Matrix Rooms Search](https://github.com/etkecc/mrs) project, but it can be used in any other project that needs to interact with the admin contact API. diff --git a/contact.go b/contact.go index c9f31ca..afcfb04 100644 --- a/contact.go +++ b/contact.go @@ -29,6 +29,7 @@ type Contact struct { Email string `json:"email_address,omitempty" yaml:"email_address,omitempty"` MatrixID string `json:"matrix_id,omitempty" yaml:"matrix_id,omitempty"` Role string `json:"role,omitempty" yaml:"role,omitempty"` + PgpKey string `json:"dev.zirco.msc4439.pgp_key,omitempty" yaml:"dev.zirco.msc4439.pgp_key,omitempty"` } // IsEmpty checks if contact contains at least one contact (either email or mxid) diff --git a/response_test.go b/response_test.go index c2627c5..e06783a 100644 --- a/response_test.go +++ b/response_test.go @@ -13,6 +13,7 @@ func TestContact_IsEmpty(t *testing.T) { {"nil contact", nil, true}, {"empty contact", &Contact{}, true}, {"contact with email", &Contact{Email: "test@example.com"}, false}, + {"contact with email and PGP key", &Contact{Email: "test@example.com", PgpKey:"https://example.com/pgp.key"}, false}, {"contact with matrix ID", &Contact{MatrixID: "@user:example.com"}, false}, {"contact with both", &Contact{Email: "test@example.com", MatrixID: "@user:example.com"}, false}, }