resolve remote account when displaying it
This commit is contained in:
parent
fa4f1f235f
commit
4825aa53d0
|
@ -71,7 +71,7 @@ export class StreamOverlayComponent implements OnInit {
|
|||
return;
|
||||
}
|
||||
|
||||
this.mastodonService.search(selectedAccounts[0], accountName)
|
||||
this.mastodonService.search(selectedAccounts[0], accountName, true)
|
||||
.then((result: Results) => {
|
||||
this.account = result.accounts[0];
|
||||
});
|
||||
|
|
|
@ -117,6 +117,12 @@ export class MastodonService {
|
|||
return this.httpClient.get<Results>(route, { headers: headers }).toPromise()
|
||||
}
|
||||
|
||||
searchAccount(account: AccountInfo, query: string, limit: number = 40, following: boolean = false): Promise<Account[]>{
|
||||
const route = `https://${account.instance}${this.apiRoutes.searchForAccounts}?q=${query}&limit=${limit}&following=${following}`;
|
||||
const headers = new HttpHeaders({ 'Authorization': `Bearer ${account.token.access_token}` });
|
||||
return this.httpClient.get<Account[]>(route, { headers: headers }).toPromise()
|
||||
}
|
||||
|
||||
reblog(account: AccountInfo, status: Status): Promise<Status> {
|
||||
const route = `https://${account.instance}${this.apiRoutes.reblogStatus}`.replace('{0}', status.id);
|
||||
const headers = new HttpHeaders({ 'Authorization': `Bearer ${account.token.access_token}` });
|
||||
|
|
Loading…
Reference in New Issue