Skip to content

Commit

Permalink
Add Toot timestamps to toot_fetched event in mastodonbee
Browse files Browse the repository at this point in the history
Now the toot_fetched event also returns a timestamp of the toot.
As we can already delete toots by ID this change can be used for more complex
chains with mastodon. E.g. Automatically remove toots from your timeline after X
days.
This resolves #247
  • Loading branch information
penguwin committed Oct 3, 2020
1 parent 20a8b2b commit 70d1ee8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bees/mastodonbee/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ func (mod *MastodonBee) handleStatus(status *mastodon.Status) {
Value: status.URL,
Type: "string",
},
{
Name: "created",
Value: status.CreatedAt,
Type: "time.Time",
},
},
}
mod.evchan <- ev
Expand Down
5 changes: 5 additions & 0 deletions bees/mastodonbee/mastodonbeefactory.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,11 @@ func (factory *MastodonBeeFactory) Events() []bees.EventDescriptor {
Description: "The url for the toot",
Type: "string",
},
{
Name: "created",
Description: "The timestamp of the toots creation",
Type: "time.Time",
},
},
},
{
Expand Down

0 comments on commit 70d1ee8

Please sign in to comment.