Fixed invalid types and bugs in MessageReferencer

This commit is contained in:
diamondburned 2020-12-17 17:18:02 -08:00
parent f1db8e0601
commit 24fc2c9bbb
4 changed files with 15 additions and 12 deletions

Binary file not shown.

View File

@ -113,6 +113,7 @@ var Main = Packages{
AsserterMethod{ChildType: "Attributor"},
AsserterMethod{ChildType: "Codeblocker"},
AsserterMethod{ChildType: "Quoteblocker"},
AsserterMethod{ChildType: "MessageReferencer"},
},
}, {
Comment: Comment{`
@ -128,7 +129,7 @@ var Main = Packages{
Methods: []Method{
GetterMethod{
method: method{Name: "MessageID"},
Returns: []NamedType{{Type: "cchat.ID"}},
Returns: []NamedType{{Type: "string"}},
},
},
}, {

View File

@ -11,8 +11,6 @@
// shouldn't be.
package text
import cchat "cchat"
// Attribute is the type for basic rich text markup attributes.
type Attribute uint32
@ -147,7 +145,7 @@ type Mentioner interface {
// and highlight it, though this is also for appearance, so the frontend may
// decide in detail how to display it.
type MessageReferencer interface {
MessageID() cchat.ID
MessageID() string
}
// Quoteblocker represents a quoteblock that behaves similarly to the blockquote
@ -172,12 +170,13 @@ type Segment interface {
// Asserters.
AsColorer() Colorer // Optional
AsLinker() Linker // Optional
AsImager() Imager // Optional
AsAvatarer() Avatarer // Optional
AsMentioner() Mentioner // Optional
AsAttributor() Attributor // Optional
AsCodeblocker() Codeblocker // Optional
AsQuoteblocker() Quoteblocker // Optional
AsColorer() Colorer // Optional
AsLinker() Linker // Optional
AsImager() Imager // Optional
AsAvatarer() Avatarer // Optional
AsMentioner() Mentioner // Optional
AsAttributor() Attributor // Optional
AsCodeblocker() Codeblocker // Optional
AsQuoteblocker() Quoteblocker // Optional
AsMessageReferencer() MessageReferencer // Optional
}

View File

@ -140,3 +140,6 @@ func (TextSegment) AsCodeblocker() text.Codeblocker { return nil }
// AsQuoteblocker returns nil.
func (TextSegment) AsQuoteblocker() text.Quoteblocker { return nil }
// AsMessageReferencer returns nil.
func (TextSegment) AsMessageReferencer() text.MessageReferencer { return nil }