Fix issue #913 - Fix Nitter feeds

markdown
Thomas 1 year ago
parent 022d27ecb4
commit cf4b156863

@ -1817,8 +1817,8 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
if (networkStateReceiver != null) { if (networkStateReceiver != null) {
try { try {
unregisterReceiver(networkStateReceiver); unregisterReceiver(networkStateReceiver);
} catch (IllegalArgumentException illegalArgumentException) { } catch (IllegalArgumentException e) {
illegalArgumentException.printStackTrace(); e.printStackTrace();
} }
} }
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(BaseMainActivity.this); SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(BaseMainActivity.this);

@ -210,7 +210,7 @@ public class ReorderTimelinesActivity extends BaseBarActivity implements OnStart
} else if (popupSearchInstanceBinding.setAttachmentGroup.getCheckedRadioButtonId() == R.id.twitter_accounts) { } else if (popupSearchInstanceBinding.setAttachmentGroup.getCheckedRadioButtonId() == R.id.twitter_accounts) {
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(ReorderTimelinesActivity.this); SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(ReorderTimelinesActivity.this);
String nitterHost = sharedpreferences.getString(getString(R.string.SET_NITTER_HOST), getString(R.string.DEFAULT_NITTER_HOST)).toLowerCase(); String nitterHost = sharedpreferences.getString(getString(R.string.SET_NITTER_HOST), getString(R.string.DEFAULT_NITTER_HOST)).toLowerCase();
url = "https://" + nitterHost + "/" + instanceName.replaceAll("[ ]+", ",").replaceAll("\\s", "") + "/rss"; url = "https://" + nitterHost + "/" + instanceName.replaceAll("[ ]+", ",").replaceAll("\\s", "") + "/with_replies/rss";
} }
OkHttpClient client = new OkHttpClient.Builder() OkHttpClient client = new OkHttpClient.Builder()
.connectTimeout(10, TimeUnit.SECONDS) .connectTimeout(10, TimeUnit.SECONDS)

@ -263,14 +263,14 @@ public interface MastodonTimelinesService {
); );
@Headers({"Accept: text/html,application/xhtml+xml,application/xml"}) @Headers({"Accept: text/html,application/xhtml+xml,application/xml"})
@GET("{names}/rss") @GET("{names}/with_replies/rss")
Call<Nitter> getNitter( Call<Nitter> getNitter(
@Path("names") String id, @Path("names") String id,
@Query("max_position") String max_position @Query("max_position") String max_position
); );
@Headers({"Accept: text/html,application/xhtml+xml,application/xml"}) @Headers({"Accept: text/html,application/xhtml+xml,application/xml"})
@GET("{account}/rss") @GET("{account}/with_replies/rss")
Call<Nitter> getNitterAccount( Call<Nitter> getNitterAccount(
@Path("account") String account @Path("account") String account
); );

@ -260,7 +260,6 @@ public class TimelinesVM extends AndroidViewModel {
if (publicTlCall != null) { if (publicTlCall != null) {
try { try {
Response<Nitter> publicTlResponse = publicTlCall.execute(); Response<Nitter> publicTlResponse = publicTlCall.execute();
if (publicTlResponse.isSuccessful()) { if (publicTlResponse.isSuccessful()) {
Nitter rssResponse = publicTlResponse.body(); Nitter rssResponse = publicTlResponse.body();
List<Status> statusList = new ArrayList<>(); List<Status> statusList = new ArrayList<>();

Loading…
Cancel
Save