Merge pull request #171 from NicolasConstant/develop

0.16.2 PR
This commit is contained in:
Nicolas Constant 2019-09-25 18:54:22 -04:00 committed by GitHub
commit 088f92a15b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View File

@ -1,6 +1,6 @@
{
"name": "sengi",
"version": "0.16.1",
"version": "0.16.2",
"license": "AGPL-3.0-or-later",
"main": "main-electron.js",
"description": "A multi-account desktop client for Mastodon and Pleroma",

View File

@ -136,6 +136,16 @@ export class MastodonService {
const route = `https://${account.instance}${searchRoute}?q=${query}&resolve=${resolve}`;
const headers = new HttpHeaders({ 'Authorization': `Bearer ${account.token.access_token}` });
return this.httpClient.get<Results>(route, { headers: headers }).toPromise()
.then((result: Results) => {
if(version === 'v2'){
result = {
accounts: result.accounts,
statuses: result.statuses,
hashtags: result.hashtags.map(x => (<any>x).name)
}
}
return result;
});
}
getAccountStatuses(account: AccountInfo, targetAccountId: number, onlyMedia: boolean, onlyPinned: boolean, excludeReplies: boolean, maxId: string, sinceId: string, limit: number = 20): Promise<Status[]> {