Commit e0b8b60f authored by Thomas's avatar Thomas
Browse files

Fix issue #1130 - Follow Pixelfed instance from the discover timeline

parent 885e8eb5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -100,7 +100,7 @@ allprojects {
    }
}
dependencies {
    implementation 'org.unifiedpush.android:connector:3.0.4'
    implementation 'org.unifiedpush.android:connector:3.0.5'

    playstoreImplementation('org.unifiedpush.android:embedded-fcm-distributor:3.0.0')

+1 −1
Original line number Diff line number Diff line
@@ -200,7 +200,7 @@ public class ReorderTimelinesActivity extends BaseBarActivity implements OnStart
                } else if (popupSearchInstanceBinding.setAttachmentGroup.getCheckedRadioButtonId() == R.id.peertube_instance) {
                    url = "https://" + instanceName + "/api/v1/videos/";
                } else if (popupSearchInstanceBinding.setAttachmentGroup.getCheckedRadioButtonId() == R.id.pixelfed_instance) {
                    url = "https://" + instanceName + "/api/v1/timelines/public";
                    url = "https://" + instanceName + "/api/pixelfed/v2/discover/posts/trending?range=daily";
                } else if (popupSearchInstanceBinding.setAttachmentGroup.getCheckedRadioButtonId() == R.id.misskey_instance) {
                    url = "https://" + instanceName + "/api/notes/local-timeline";
                    getCall = false;
+5 −0
Original line number Diff line number Diff line
@@ -231,6 +231,11 @@ public interface MastodonTimelinesService {
    Call<List<MisskeyNote>> getMisskey(@Body MisskeyNote.MisskeyParams params);


    @GET("discover/posts/trending")
    Call<List<Status>> getPixelDiscoverTrending(
            @Query("range") String range
    );

    @GET("api/v3/post/list?sort=New")
    Call<LemmyPost.LemmyPosts> getLemmyMain(@Query("limit") Integer limit,
                                            @Query("page") String page);
+32 −0
Original line number Diff line number Diff line
package app.fedilab.android.mastodon.client.endpoints;
/* Copyright 2025 Thomas Schneider
 *
 * This file is a part of Fedilab
 *
 * This program is free software; you can redistribute it and/or modify it under the terms of the
 * GNU General Public License as published by the Free Software Foundation; either version 3 of the
 * License, or (at your option) any later version.
 *
 * Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
 * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
 * Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with Fedilab; if not,
 * see <http://www.gnu.org/licenses>. */

import java.util.List;

import app.fedilab.android.mastodon.client.entities.api.Status;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Query;

public interface PixelfedTimelinesService {

    //Public timelines
    @GET("discover/posts/trending")
    Call<List<Status>> getTrending(
            @Query("range") String range
    );

}
+6 −1
Original line number Diff line number Diff line
@@ -1127,6 +1127,11 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
                                }
                            });
                }
            } else if (pinnedTimeline != null && pinnedTimeline.remoteInstance.type == RemoteInstance.InstanceType.PIXELFED) {
                if (direction == null) {
                    timelinesVM.getPixelfedDiscoverTrending(remoteInstance)
                            .observe(getViewLifecycleOwner(), this::initializeStatusesCommonView);
                }
            }else { //Other remote timelines
                routeCommon(direction, fetchingMissing, fetchStatus);
            }
Loading