fix(hashtag-timeline): add additional tags as separated parameter (#647)

This commit is contained in:
FineFindus 2023-07-03 01:32:56 +02:00 committed by GitHub
parent 277282d7f5
commit d47c4e63d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 7 deletions

View File

@ -13,19 +13,23 @@ import java.util.List;
public class GetHashtagTimeline extends MastodonAPIRequest<List<Status>>{
public GetHashtagTimeline(String hashtag, String maxID, String minID, int limit, List<String> containsAny, List<String> containsAll, List<String> containsNone, boolean localOnly){
super(HttpMethod.GET, "/timelines/tag/"+hashtag, new TypeToken<>(){});
if (localOnly) addQueryParameter("local", "true");
if (localOnly)
addQueryParameter("local", "true");
if(maxID!=null)
addQueryParameter("max_id", maxID);
if(minID!=null)
addQueryParameter("min_id", minID);
if(limit>0)
addQueryParameter("limit", ""+limit);
if(containsAny!=null && !containsAny.isEmpty())
addQueryParameter("any[]", "[" + TextUtils.join(",", containsAny) + "]");
if(containsAll!=null && !containsAll.isEmpty())
addQueryParameter("all[]", "[" + TextUtils.join(",", containsAll) + "]");
if(containsNone!=null && !containsNone.isEmpty())
addQueryParameter("none[]", "[" + TextUtils.join(",", containsNone) + "]");
if(containsAny!=null)
for (String tag : containsAny)
addQueryParameter("any[]", tag);
if(containsAll!=null)
for (String tag : containsAll)
addQueryParameter("all[]", tag);
if(containsNone!=null)
for (String tag : containsNone)
addQueryParameter("none[]", tag);
}
public GetHashtagTimeline(String hashtag, String maxID, String minID, int limit){