diff --git a/repository/gob/repository.gob b/repository/gob/repository.gob index 5fe1e10..8337ab5 100644 Binary files a/repository/gob/repository.gob and b/repository/gob/repository.gob differ diff --git a/repository/main.go b/repository/main.go index 12285be..2982512 100644 --- a/repository/main.go +++ b/repository/main.go @@ -114,6 +114,23 @@ var Main = Packages{ AsserterMethod{ChildType: "Codeblocker"}, AsserterMethod{ChildType: "Quoteblocker"}, }, + }, { + Comment: Comment{` + MessageReferencer is similar to Linker, except it references a + message instead of an arbitrary URL. As such, its appearance may + be formatted similarly to a link, but this is up to the frontend + to decide. When clicked, the frontend should scroll to the + message with the ID returned by MessageID() and highlight it, + though this is also for appearance, so the frontend may decide + in detail how to display it. + `}, + Name: "MessageReferencer", + Methods: []Method{ + GetterMethod{ + method: method{Name: "MessageID"}, + Returns: []NamedType{{Type: "cchat.ID"}}, + }, + }, }, { Comment: Comment{` Linker is a hyperlink format that a segment could implement. diff --git a/text/text.go b/text/text.go index 213d373..816062b 100644 --- a/text/text.go +++ b/text/text.go @@ -11,6 +11,8 @@ // shouldn't be. package text +import cchat "cchat" + // Attribute is the type for basic rich text markup attributes. type Attribute uint32 @@ -138,6 +140,16 @@ type Mentioner interface { MentionInfo() Rich } +// MessageReferencer is similar to Linker, except it references a message +// instead of an arbitrary URL. As such, its appearance may be formatted +// similarly to a link, but this is up to the frontend to decide. When clicked, +// the frontend should scroll to the message with the ID returned by MessageID() +// 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 +} + // Quoteblocker represents a quoteblock that behaves similarly to the blockquote // HTML tag. The quoteblock may be represented typically by an actaul quoteblock // or with green arrows prepended to each line.