Add support for edited statuses

ActivityPub supports "status.update" for editing statuses. These should
be made available for streams.
This commit is contained in:
Brint E. Kriebel 2022-12-20 22:37:57 -08:00 committed by mattn
parent 6e810f25fa
commit 9faaa4f0dc
6 changed files with 66 additions and 9 deletions

View file

@ -28,6 +28,8 @@ event: notification
data: {"type": "mention"}
event: delete
data: 1234567
event: status.update
data: {"content": "foo"}
:thump
`, largeContent))
var wg sync.WaitGroup
@ -51,6 +53,14 @@ data: 1234567
} else {
t.Fatalf("bad update content: %q", event.Status.Content)
}
case *UpdateEditEvent:
if event.Status.Content == "foo" {
passUpdate = true
} else if event.Status.Content == largeContent {
passUpdateLarge = true
} else {
t.Fatalf("bad update content: %q", event.Status.Content)
}
case *NotificationEvent:
passNotification = true
if event.Notification.Type != "mention" {
@ -125,6 +135,12 @@ data: {"content": "foo"}
if event.Status.Content != "foo" {
t.Fatalf("want %q but %q", "foo", event.Status.Content)
}
case *UpdateEditEvent:
cnt++
passUpdate = true
if event.Status.Content != "foo" {
t.Fatalf("want %q but %q", "foo", event.Status.Content)
}
}
}
if cnt != 1 {