Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Sharkey
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Charlotte
Sharkey
Commits
3b3bd686
Commit
3b3bd686
authored
5 months ago
by
dakkar
Browse files
Options
Downloads
Patches
Plain Diff
use injected meta in MastodonApiServerService
parent
9200d35f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
packages/backend/src/server/api/mastodon/MastodonApiServerService.ts
+4
-3
4 additions, 3 deletions
...ckend/src/server/api/mastodon/MastodonApiServerService.ts
with
4 additions
and
3 deletions
packages/backend/src/server/api/mastodon/MastodonApiServerService.ts
+
4
−
3
View file @
3b3bd686
...
...
@@ -8,11 +8,10 @@ import megalodon, { Entity, MegalodonInterface } from 'megalodon';
import
querystring
from
'
querystring
'
;
import
{
IsNull
}
from
'
typeorm
'
;
import
multer
from
'
fastify-multer
'
;
import
type
{
AccessTokensRepository
,
NoteEditRepository
,
NotesRepository
,
UserProfilesRepository
,
UsersRepository
}
from
'
@/models/_.js
'
;
import
type
{
AccessTokensRepository
,
NoteEditRepository
,
NotesRepository
,
UserProfilesRepository
,
UsersRepository
,
MiMeta
}
from
'
@/models/_.js
'
;
import
{
DI
}
from
'
@/di-symbols.js
'
;
import
{
bindThis
}
from
'
@/decorators.js
'
;
import
type
{
Config
}
from
'
@/config.js
'
;
import
{
MetaService
}
from
'
@/core/MetaService.js
'
;
import
{
convertAnnouncement
,
convertFilter
,
convertAttachment
,
convertFeaturedTag
,
convertList
,
MastoConverters
}
from
'
./converters.js
'
;
import
{
getInstance
}
from
'
./endpoints/meta.js
'
;
import
{
ApiAuthMastodon
,
ApiAccountMastodon
,
ApiFilterMastodon
,
ApiNotifyMastodon
,
ApiSearchMastodon
,
ApiTimelineMastodon
,
ApiStatusMastodon
}
from
'
./endpoints.js
'
;
...
...
@@ -31,6 +30,8 @@ export function getClient(BASE_URL: string, authorization: string | undefined):
@
Injectable
()
export
class
MastodonApiServerService
{
constructor
(
@
Inject
(
DI
.
meta
)
private
serverSettings
:
MiMeta
,
@
Inject
(
DI
.
usersRepository
)
private
usersRepository
:
UsersRepository
,
@
Inject
(
DI
.
notesRepository
)
...
...
@@ -112,7 +113,7 @@ export class MastodonApiServerService {
order
:
{
id
:
'
ASC
'
},
});
const
contact
=
admin
==
null
?
null
:
await
this
.
mastoConverter
.
convertAccount
((
await
client
.
getAccount
(
admin
.
id
)).
data
);
reply
.
send
(
await
getInstance
(
data
.
data
,
contact
as
Entity
.
Account
,
this
.
config
,
await
this
.
metaService
.
fetch
()
));
reply
.
send
(
await
getInstance
(
data
.
data
,
contact
as
Entity
.
Account
,
this
.
config
,
this
.
serverSettings
));
}
catch
(
e
:
any
)
{
/* console.error(e); */
reply
.
code
(
401
).
send
(
e
.
response
.
data
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment