mirror of
https://activitypub.software/TransFem-org/Sharkey
synced 2024-11-30 01:43:03 +00:00
fix: fetching remote users on elk via megalodon
This commit is contained in:
parent
151fcb2d5c
commit
f15b7fb250
1 changed files with 21 additions and 0 deletions
|
@ -2035,6 +2035,27 @@ export default class Misskey implements MegalodonInterface {
|
|||
})
|
||||
}
|
||||
}
|
||||
const match = q.match(/^@?(?<user>[a-zA-Z0-9_]+)(?:@(?<host>[a-zA-Z0-9-.]+\.[a-zA-Z0-9-]+)|)$/);
|
||||
if (match) {
|
||||
const lookupQuery = {
|
||||
username: match.groups?.user,
|
||||
host: match.groups?.host,
|
||||
};
|
||||
|
||||
return await this.client.post<MisskeyAPI.Entity.UserDetail>('/api/users/show', lookupQuery).then((res) => ({
|
||||
...res,
|
||||
data: {
|
||||
accounts: [
|
||||
MisskeyAPI.Converter.userDetail(
|
||||
res.data,
|
||||
this.baseUrl,
|
||||
),
|
||||
],
|
||||
statuses: [],
|
||||
hashtags: [],
|
||||
},
|
||||
}));
|
||||
}
|
||||
return this.client.post<Array<MisskeyAPI.Entity.UserDetail>>('/api/users/search', params).then(res => ({
|
||||
...res,
|
||||
data: {
|
||||
|
|
Loading…
Reference in a new issue