Add support for edited statuses
ActivityPub supports "status.update" for editing statuses. These should be made available for streams.
This commit is contained in:
parent
6e810f25fa
commit
9faaa4f0dc
6 changed files with 66 additions and 9 deletions
|
@ -87,7 +87,16 @@ func cmdStream(c *cli.Context) error {
|
|||
if asJSON {
|
||||
json.NewEncoder(c.App.Writer).Encode(e)
|
||||
} else if asSimpleJSON {
|
||||
if t, ok := e.(*mastodon.UpdateEvent); ok {
|
||||
switch t := e.(type) {
|
||||
case *mastodon.UpdateEvent:
|
||||
json.NewEncoder(c.App.Writer).Encode(&SimpleJSON{
|
||||
ID: t.Status.ID,
|
||||
Username: t.Status.Account.Username,
|
||||
Acct: t.Status.Account.Acct,
|
||||
Avatar: t.Status.Account.AvatarStatic,
|
||||
Content: textContent(t.Status.Content),
|
||||
})
|
||||
case *mastodon.UpdateEditEvent:
|
||||
json.NewEncoder(c.App.Writer).Encode(&SimpleJSON{
|
||||
ID: t.Status.ID,
|
||||
Username: t.Status.Account.Username,
|
||||
|
@ -102,6 +111,8 @@ func cmdStream(c *cli.Context) error {
|
|||
switch t := e.(type) {
|
||||
case *mastodon.UpdateEvent:
|
||||
s.displayStatus(c.App.Writer, t.Status)
|
||||
case *mastodon.UpdateEditEvent:
|
||||
s.displayStatus(c.App.Writer, t.Status)
|
||||
case *mastodon.NotificationEvent:
|
||||
// TODO s.displayStatus(c.App.Writer, t.Notification.Status)
|
||||
case *mastodon.ErrorEvent:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue