diff --git a/cchat.go b/cchat.go index 10f794b..c042da3 100644 --- a/cchat.go +++ b/cchat.go @@ -523,7 +523,9 @@ type MessageHeader interface { // behaves similarly to MessageCreate, except all fields are optional. The // frontend is responsible for checking which field is not empty and check it. type MessageUpdate interface { - MessageCreate + MessageHeader + + Content() text.Rich } // MessagesContainer is a view implementation that displays a list of messages diff --git a/repository/gob/repository.gob b/repository/gob/repository.gob index 5170001..035a101 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 9353a5e..ba9fcdb 100644 --- a/repository/main.go +++ b/repository/main.go @@ -1602,12 +1602,20 @@ var Main = Packages{ }, { Comment: Comment{` MessageUpdate is the interface for a message update (or edit) - event. It behaves similarly to MessageCreate, except all fields - are optional. The frontend is responsible for checking which - field is not empty and check it. + event. It is only responsible for updating a message's content. + The author's name should be updated using MessageCreate's + Author. `}, Name: "MessageUpdate", - Embeds: []EmbeddedInterface{{InterfaceName: "MessageCreate"}}, + Embeds: []EmbeddedInterface{{InterfaceName: "MessageHeader"}}, + Methods: []Method{ + GetterMethod{ + method: method{Name: "Content"}, + Returns: []NamedType{{ + Type: MakeQual("text", "Rich"), + }}, + }, + }, }, { Comment: Comment{` MessageDelete is the interface for a message delete event.