Author now has Name() over Namer

Prior to this commit, interface Author embedded interface Namer. This
doesn't work, as it is discouraged to keep a working state inside the
implementation of Author, but Namer's embedded Iconer requires a state.

The commit changed Author to use a Name method instead, which is only a
getter. It will no longer satisfy interface Name.
This commit is contained in:
diamondburned 2020-10-03 22:52:21 -07:00
parent 1588cfef9c
commit aaa29f35b0
2 changed files with 10 additions and 2 deletions

View File

@ -210,7 +210,8 @@ type Authenticator interface {
// The frontend may use the ID to squash messages with the same author together.
type Author interface {
Identifier
Namer
Name() text.Rich
}
// Backlogger adds message history capabilities into a message container. The

View File

@ -589,7 +589,14 @@ var Main = Packages{
Name: "Author",
Embeds: []EmbeddedInterface{
{InterfaceName: "Identifier"},
{InterfaceName: "Namer"},
},
Methods: []Method{
GetterMethod{
method: method{Name: "Name"},
Returns: []NamedType{{
Type: MakeQual("text", "Rich"),
}},
},
},
}, {
Comment: Comment{`