Fixed invalid types and bugs in MessageReferencer
This commit is contained in:
parent
f1db8e0601
commit
24fc2c9bbb
Binary file not shown.
|
@ -113,6 +113,7 @@ var Main = Packages{
|
||||||
AsserterMethod{ChildType: "Attributor"},
|
AsserterMethod{ChildType: "Attributor"},
|
||||||
AsserterMethod{ChildType: "Codeblocker"},
|
AsserterMethod{ChildType: "Codeblocker"},
|
||||||
AsserterMethod{ChildType: "Quoteblocker"},
|
AsserterMethod{ChildType: "Quoteblocker"},
|
||||||
|
AsserterMethod{ChildType: "MessageReferencer"},
|
||||||
},
|
},
|
||||||
}, {
|
}, {
|
||||||
Comment: Comment{`
|
Comment: Comment{`
|
||||||
|
@ -128,7 +129,7 @@ var Main = Packages{
|
||||||
Methods: []Method{
|
Methods: []Method{
|
||||||
GetterMethod{
|
GetterMethod{
|
||||||
method: method{Name: "MessageID"},
|
method: method{Name: "MessageID"},
|
||||||
Returns: []NamedType{{Type: "cchat.ID"}},
|
Returns: []NamedType{{Type: "string"}},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}, {
|
}, {
|
||||||
|
|
21
text/text.go
21
text/text.go
|
@ -11,8 +11,6 @@
|
||||||
// shouldn't be.
|
// shouldn't be.
|
||||||
package text
|
package text
|
||||||
|
|
||||||
import cchat "cchat"
|
|
||||||
|
|
||||||
// Attribute is the type for basic rich text markup attributes.
|
// Attribute is the type for basic rich text markup attributes.
|
||||||
type Attribute uint32
|
type Attribute uint32
|
||||||
|
|
||||||
|
@ -147,7 +145,7 @@ type Mentioner interface {
|
||||||
// and highlight it, though this is also for appearance, so the frontend may
|
// and highlight it, though this is also for appearance, so the frontend may
|
||||||
// decide in detail how to display it.
|
// decide in detail how to display it.
|
||||||
type MessageReferencer interface {
|
type MessageReferencer interface {
|
||||||
MessageID() cchat.ID
|
MessageID() string
|
||||||
}
|
}
|
||||||
|
|
||||||
// Quoteblocker represents a quoteblock that behaves similarly to the blockquote
|
// Quoteblocker represents a quoteblock that behaves similarly to the blockquote
|
||||||
|
@ -172,12 +170,13 @@ type Segment interface {
|
||||||
|
|
||||||
// Asserters.
|
// Asserters.
|
||||||
|
|
||||||
AsColorer() Colorer // Optional
|
AsColorer() Colorer // Optional
|
||||||
AsLinker() Linker // Optional
|
AsLinker() Linker // Optional
|
||||||
AsImager() Imager // Optional
|
AsImager() Imager // Optional
|
||||||
AsAvatarer() Avatarer // Optional
|
AsAvatarer() Avatarer // Optional
|
||||||
AsMentioner() Mentioner // Optional
|
AsMentioner() Mentioner // Optional
|
||||||
AsAttributor() Attributor // Optional
|
AsAttributor() Attributor // Optional
|
||||||
AsCodeblocker() Codeblocker // Optional
|
AsCodeblocker() Codeblocker // Optional
|
||||||
AsQuoteblocker() Quoteblocker // Optional
|
AsQuoteblocker() Quoteblocker // Optional
|
||||||
|
AsMessageReferencer() MessageReferencer // Optional
|
||||||
}
|
}
|
||||||
|
|
|
@ -140,3 +140,6 @@ func (TextSegment) AsCodeblocker() text.Codeblocker { return nil }
|
||||||
|
|
||||||
// AsQuoteblocker returns nil.
|
// AsQuoteblocker returns nil.
|
||||||
func (TextSegment) AsQuoteblocker() text.Quoteblocker { return nil }
|
func (TextSegment) AsQuoteblocker() text.Quoteblocker { return nil }
|
||||||
|
|
||||||
|
// AsMessageReferencer returns nil.
|
||||||
|
func (TextSegment) AsMessageReferencer() text.MessageReferencer { return nil }
|
||||||
|
|
Loading…
Reference in New Issue