megalodon/megalodon/src/pleroma/entities/announcement.ts
fruye 3e9e1635e2
Implement getting and dismissing server announcements (#4)
to be fair, I didn't test it on a real mastodon server. I just hope it works. I also don't think it matters much anyway as this is a fork for calckey? idk please let me know if I need to test it on mastodon too.

It's a bit silly implementation as mfm is just escaped to plaintext and the announcement title is glued to `content`, but overall I think it works fine :)

Reviewed-on: https://codeberg.org/calckey/megalodon/pulls/4
Co-authored-by: fruye <fruye@unix.dog>
Co-committed-by: fruye <fruye@unix.dog>
2023-07-02 06:57:17 +02:00

35 lines
712 B
TypeScript

/// <reference path="tag.ts" />
/// <reference path="emoji.ts" />
/// <reference path="reaction.ts" />
namespace PleromaEntity {
export type Announcement = {
id: string
content: string
starts_at: string | null
ends_at: string | null
published: boolean
all_day: boolean
published_at: string
updated_at: string
read?: boolean
mentions: Array<AnnouncementAccount>
statuses: Array<AnnouncementStatus>
tags: Array<Tag>
emojis: Array<Emoji>
reactions: Array<Reaction>
}
export type AnnouncementAccount = {
id: string
username: string
url: string
acct: string
}
export type AnnouncementStatus = {
id: string
url: string
}
}