mirror of
https://mau.dev/mautrix/go.git
synced 2026-03-14 14:25:53 +01:00
Un-pointerify ContentURI stringify methods
This commit is contained in:
parent
eebf23cd31
commit
a4af074c64
1 changed files with 3 additions and 3 deletions
|
|
@ -117,17 +117,17 @@ func (uri ContentURI) MarshalText() ([]byte, error) {
|
|||
return []byte(uri.String()), nil
|
||||
}
|
||||
|
||||
func (uri *ContentURI) String() string {
|
||||
func (uri ContentURI) String() string {
|
||||
if uri.IsEmpty() {
|
||||
return ""
|
||||
}
|
||||
return fmt.Sprintf("mxc://%s/%s", uri.Homeserver, uri.FileID)
|
||||
}
|
||||
|
||||
func (uri *ContentURI) CUString() ContentURIString {
|
||||
func (uri ContentURI) CUString() ContentURIString {
|
||||
return ContentURIString(uri.String())
|
||||
}
|
||||
|
||||
func (uri *ContentURI) IsEmpty() bool {
|
||||
func (uri ContentURI) IsEmpty() bool {
|
||||
return len(uri.Homeserver) == 0 || len(uri.FileID) == 0
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue