Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
1 change: 1 addition & 0 deletions contact.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions response_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
}
Expand Down