summaryrefslogtreecommitdiff
path: root/src/models
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2020-02-01 07:16:52 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2020-02-01 07:16:52 +0900
commit7ed3448e13847f3ba807be1354e90c912fbefd9a (patch)
treea9d91176e5a95f90e2af570ae900641f651e77aa /src/models
parentUpdate gulpfile.ts (diff)
downloadmisskey-7ed3448e13847f3ba807be1354e90c912fbefd9a.tar.gz
misskey-7ed3448e13847f3ba807be1354e90c912fbefd9a.tar.bz2
misskey-7ed3448e13847f3ba807be1354e90c912fbefd9a.zip
Resolve #1669
Diffstat (limited to 'src/models')
-rw-r--r--src/models/entities/user-profile.ts83
-rw-r--r--src/models/repositories/user.ts14
2 files changed, 4 insertions, 93 deletions
diff --git a/src/models/entities/user-profile.ts b/src/models/entities/user-profile.ts
index 1244fa4390..278e8ce815 100644
--- a/src/models/entities/user-profile.ts
+++ b/src/models/entities/user-profile.ts
@@ -137,87 +137,10 @@ export class UserProfile {
@JoinColumn()
public pinnedPage: Page | null;
- //#region Linking
- @Column('boolean', {
- default: false,
- })
- public twitter: boolean;
-
- @Column('varchar', {
- length: 64, nullable: true, default: null,
- })
- public twitterAccessToken: string | null;
-
- @Column('varchar', {
- length: 64, nullable: true, default: null,
- })
- public twitterAccessTokenSecret: string | null;
-
- @Column('varchar', {
- length: 64, nullable: true, default: null,
- })
- public twitterUserId: string | null;
-
- @Column('varchar', {
- length: 64, nullable: true, default: null,
- })
- public twitterScreenName: string | null;
-
- @Column('boolean', {
- default: false,
- })
- public github: boolean;
-
- @Column('varchar', {
- length: 64, nullable: true, default: null,
- })
- public githubAccessToken: string | null;
-
- @Column('varchar', {
- length: 64, nullable: true, default: null,
- })
- public githubId: string | null;
-
- @Column('varchar', {
- length: 64, nullable: true, default: null,
- })
- public githubLogin: string | null;
-
- @Column('boolean', {
- default: false,
- })
- public discord: boolean;
-
- @Column('varchar', {
- length: 64, nullable: true, default: null,
- })
- public discordAccessToken: string | null;
-
- @Column('varchar', {
- length: 64, nullable: true, default: null,
- })
- public discordRefreshToken: string | null;
-
- @Column('varchar', {
- length: 64, nullable: true, default: null,
- })
- public discordExpiresDate: string | null;
-
- @Column('varchar', {
- length: 64, nullable: true, default: null,
- })
- public discordId: string | null;
-
- @Column('varchar', {
- length: 64, nullable: true, default: null,
- })
- public discordUsername: string | null;
-
- @Column('varchar', {
- length: 64, nullable: true, default: null,
+ @Column('jsonb', {
+ default: {}
})
- public discordDiscriminator: string | null;
- //#endregion
+ public integrations: Record<string, any>;
//#region Denormalized fields
@Index()
diff --git a/src/models/repositories/user.ts b/src/models/repositories/user.ts
index 3b3ed6b793..25ce00cdc4 100644
--- a/src/models/repositories/user.ts
+++ b/src/models/repositories/user.ts
@@ -213,19 +213,6 @@ export class UserRepository extends Repository<User> {
userId: user.id
}).then(result => result >= 1)
: false,
- twitter: profile!.twitter ? {
- id: profile!.twitterUserId,
- screenName: profile!.twitterScreenName
- } : null,
- github: profile!.github ? {
- id: profile!.githubId,
- login: profile!.githubLogin
- } : null,
- discord: profile!.discord ? {
- id: profile!.discordId,
- username: profile!.discordUsername,
- discriminator: profile!.discordDiscriminator
- } : null,
} : {}),
...(opts.detail && meId === user.id ? {
@@ -242,6 +229,7 @@ export class UserRepository extends Repository<User> {
pendingReceivedFollowRequestsCount: FollowRequests.count({
followeeId: user.id
}),
+ integrations: profile?.integrations,
} : {}),
...(opts.includeSecrets ? {