Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update account entity according to the latest mastodon #1847

Merged
merged 1 commit into from
Aug 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions megalodon/src/entities/account.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/// <reference path="emoji.ts" />
/// <reference path="source.ts" />
/// <reference path="field.ts" />
/// <reference path="role.ts" />
namespace Entity {
export type Account = {
id: string
Expand All @@ -10,6 +11,9 @@ namespace Entity {
locked: boolean
discoverable?: boolean
group: boolean | null
noindex: boolean | null
suspended: boolean | null
limited: boolean | null
created_at: string
followers_count: number
following_count: number
Expand All @@ -25,5 +29,7 @@ namespace Entity {
fields: Array<Field>
bot: boolean | null
source?: Source
role?: Role
mute_expires_at?: string
}
}
5 changes: 5 additions & 0 deletions megalodon/src/entities/role.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
namespace Entity {
export type Role = {
name: string
}
}
3 changes: 3 additions & 0 deletions megalodon/src/friendica/api_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,9 @@ namespace FriendicaAPI {
locked: a.locked,
discoverable: a.discoverable,
group: a.group,
noindex: null,
suspended: null,
limited: null,
created_at: a.created_at,
followers_count: a.followers_count,
following_count: a.following_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 @@ -469,6 +469,7 @@ namespace MastodonAPI {
export type Relationship = MastodonEntity.Relationship
export type Report = MastodonEntity.Report
export type Results = MastodonEntity.Results
export type Role = MastodonEntity.Role
export type ScheduledStatus = MastodonEntity.ScheduledStatus
export type Source = MastodonEntity.Source
export type Stats = MastodonEntity.Stats
Expand Down
6 changes: 6 additions & 0 deletions megalodon/src/mastodon/entities/account.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/// <reference path="emoji.ts" />
/// <reference path="source.ts" />
/// <reference path="field.ts" />
/// <reference path="role.ts" />
namespace MastodonEntity {
export type Account = {
id: string
Expand All @@ -10,6 +11,9 @@ namespace MastodonEntity {
locked: boolean
discoverable?: boolean
group: boolean | null
noindex: boolean | null
suspended: boolean | null
limited: boolean | null
created_at: string
followers_count: number
following_count: number
Expand All @@ -25,5 +29,7 @@ namespace MastodonEntity {
fields: Array<Field>
bot: boolean
source?: Source
role?: Role
mute_expires_at?: string
}
}
5 changes: 5 additions & 0 deletions megalodon/src/mastodon/entities/role.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
namespace MastodonEntity {
export type Role = {
name: string
}
}
1 change: 1 addition & 0 deletions megalodon/src/mastodon/entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
/// <reference path="./entities/relationship.ts" />
/// <reference path="./entities/report.ts" />
/// <reference path="./entities/results.ts" />
/// <reference path="./entities/role.ts" />
/// <reference path="./entities/scheduled_status.ts" />
/// <reference path="./entities/source.ts" />
/// <reference path="./entities/stats.ts" />
Expand Down
8 changes: 7 additions & 1 deletion megalodon/src/misskey/api_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ namespace MisskeyAPI {
display_name: u.name,
locked: false,
group: null,
noindex: null,
suspended: null,
limited: null,
created_at: '',
followers_count: 0,
following_count: 0,
Expand Down Expand Up @@ -109,6 +112,9 @@ namespace MisskeyAPI {
display_name: u.name,
locked: u.isLocked,
group: null,
noindex: null,
suspended: null,
limited: null,
created_at: u.createdAt,
followers_count: u.followersCount,
following_count: u.followingCount,
Expand Down Expand Up @@ -283,7 +289,7 @@ namespace MisskeyAPI {
} else if (e) {
return mapReactionEmojis(e)
} else {
return [];
return []
}
}

Expand Down
3 changes: 3 additions & 0 deletions megalodon/src/pleroma/api_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ namespace PleromaAPI {
locked: a.locked,
discoverable: a.discoverable,
group: null,
noindex: a.noindex,
suspended: a.suspended,
limited: a.limited,
created_at: a.created_at,
followers_count: a.followers_count,
following_count: a.following_count,
Expand Down
3 changes: 3 additions & 0 deletions megalodon/src/pleroma/entities/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ namespace PleromaEntity {
display_name: string
locked: boolean
discoverable?: boolean
noindex: boolean | null
suspended: boolean | null
limited: boolean | null
created_at: string
followers_count: number
following_count: number
Expand Down
3 changes: 3 additions & 0 deletions megalodon/test/integration/mastodon.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ const account: MastodonEntity.Account = {
display_name: 'h3poteto',
locked: false,
group: false,
noindex: false,
suspended: false,
limited: false,
created_at: '2019-03-26T21:30:32',
followers_count: 10,
following_count: 10,
Expand Down
3 changes: 3 additions & 0 deletions megalodon/test/integration/mastodon/api_client.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ const account: Entity.Account = {
display_name: 'h3poteto',
locked: false,
group: false,
noindex: false,
suspended: false,
limited: false,
created_at: '2019-03-26T21:30:32',
followers_count: 10,
following_count: 10,
Expand Down
3 changes: 3 additions & 0 deletions megalodon/test/integration/pleroma.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ const account: PleromaEntity.Account = {
acct: 'h3poteto@pleroma.io',
display_name: 'h3poteto',
locked: false,
noindex: null,
suspended: null,
limited: null,
created_at: '2019-03-26T21:30:32',
followers_count: 10,
following_count: 10,
Expand Down
3 changes: 3 additions & 0 deletions megalodon/test/unit/parser.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ const account: Entity.Account = {
display_name: 'h3poteto',
locked: false,
group: false,
noindex: null,
suspended: null,
limited: null,
created_at: '2019-03-26T21:30:32',
followers_count: 10,
following_count: 10,
Expand Down
3 changes: 3 additions & 0 deletions megalodon/test/unit/pleroma/api_client.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ const account: PleromaEntity.Account = {
acct: 'h3poteto@pleroma.io',
display_name: 'h3poteto',
locked: false,
noindex: null,
suspended: null,
limited: null,
created_at: '2019-03-26T21:30:32',
followers_count: 10,
following_count: 10,
Expand Down
3 changes: 3 additions & 0 deletions megalodon/test/unit/webo_socket.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ const account: Entity.Account = {
display_name: 'h3poteto',
locked: false,
group: false,
noindex: null,
suspended: null,
limited: null,
created_at: '2019-03-26T21:30:32',
followers_count: 10,
following_count: 10,
Expand Down