Skip to content

Commit

Permalink
Merge pull request #2074 from h3poteto/feat/edited-at
Browse files Browse the repository at this point in the history
Add edited_at field for Mastodon and Pleroma status
  • Loading branch information
h3poteto authored Dec 30, 2023
2 parents 6063e19 + 6ed9796 commit 8fdb96c
Show file tree
Hide file tree
Showing 13 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions megalodon/src/entities/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export type Status = {
content: string
plain_content: string | null
created_at: string
edited_at: string | null
emojis: Emoji[]
replies_count: number
reblogs_count: number
Expand Down
1 change: 1 addition & 0 deletions megalodon/src/firefish/api_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ namespace FirefishAPI {
: '',
plain_content: n.text ? n.text : null,
created_at: n.createdAt,
edited_at: null,
// Remove reaction emojis with names containing @ from the emojis list.
emojis: Array.isArray(n.emojis) ? n.emojis.filter(e => !e.name.includes('@')).map(e => emoji(e)) : [],
replies_count: n.repliesCount,
Expand Down
1 change: 1 addition & 0 deletions megalodon/src/friendica/api_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,7 @@ namespace FriendicaAPI {
content: s.content,
plain_content: null,
created_at: s.created_at,
edited_at: null,
emojis: Array.isArray(s.emojis) ? s.emojis.map(e => emoji(e)) : [],
replies_count: s.replies_count,
reblogs_count: s.reblogs_count,
Expand Down
1 change: 1 addition & 0 deletions megalodon/src/mastodon/api_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,7 @@ namespace MastodonAPI {
content: s.content,
plain_content: null,
created_at: s.created_at,
edited_at: s.edited_at,
emojis: Array.isArray(s.emojis) ? s.emojis.map(e => emoji(e)) : [],
replies_count: s.replies_count,
reblogs_count: s.reblogs_count,
Expand Down
1 change: 1 addition & 0 deletions megalodon/src/mastodon/entities/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export type Status = {
reblog: Status | null
content: string
created_at: string
edited_at: string | null
emojis: Emoji[]
replies_count: number
reblogs_count: number
Expand Down
1 change: 1 addition & 0 deletions megalodon/src/pleroma/api_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ namespace PleromaAPI {
content: s.content,
plain_content: s.pleroma.content?.['text/plain'] ? s.pleroma.content['text/plain'] : null,
created_at: s.created_at,
edited_at: s.edited_at,
emojis: Array.isArray(s.emojis) ? s.emojis.map(e => emoji(e)) : [],
replies_count: s.replies_count,
reblogs_count: s.reblogs_count,
Expand Down
1 change: 1 addition & 0 deletions megalodon/src/pleroma/entities/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export type Status = {
reblog: Status | null
content: string
created_at: string
edited_at: string | null
emojis: Emoji[]
replies_count: number
reblogs_count: number
Expand Down
1 change: 1 addition & 0 deletions megalodon/test/integration/mastodon.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const status: MastodonEntity.Status = {
reblog: null,
content: 'hoge',
created_at: '2019-03-26T21:40:32',
edited_at: null,
emojis: [],
replies_count: 0,
reblogs_count: 0,
Expand Down
1 change: 1 addition & 0 deletions megalodon/test/integration/mastodon/api_client.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const status: Entity.Status = {
content: 'hoge',
plain_content: null,
created_at: '2019-03-26T21:40:32',
edited_at: null,
emojis: [],
replies_count: 0,
reblogs_count: 0,
Expand Down
1 change: 1 addition & 0 deletions megalodon/test/integration/pleroma.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const status: PleromaEntity.Status = {
reblog: null,
content: 'hoge',
created_at: '2019-03-26T21:40:32',
edited_at: null,
emojis: [],
replies_count: 0,
reblogs_count: 0,
Expand Down
1 change: 1 addition & 0 deletions megalodon/test/unit/mastodon/web_socket.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const status: Entity.Status = {
content: 'hoge',
plain_content: 'hoge',
created_at: '2019-03-26T21:40:32',
edited_at: null,
emojis: [],
replies_count: 0,
reblogs_count: 0,
Expand Down
1 change: 1 addition & 0 deletions megalodon/test/unit/parser.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const status: Entity.Status = {
content: 'hoge',
plain_content: 'hoge',
created_at: '2019-03-26T21:40:32',
edited_at: null,
emojis: [],
replies_count: 0,
reblogs_count: 0,
Expand Down
2 changes: 2 additions & 0 deletions megalodon/test/unit/pleroma/api_client.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ describe('api_client', () => {
reblog: null,
content: content,
created_at: '2019-03-26T21:40:32',
edited_at: null,
emojis: [],
replies_count: 0,
reblogs_count: 0,
Expand Down Expand Up @@ -192,6 +193,7 @@ describe('api_client', () => {
reblog: null,
content: content,
created_at: '2019-03-26T21:40:32',
edited_at: null,
emojis: [],
replies_count: 0,
reblogs_count: 0,
Expand Down

0 comments on commit 8fdb96c

Please sign in to comment.