Some fixes + mute domains
This commit is contained in:
parent
480c05c4c9
commit
3244146aa5
|
@ -5032,8 +5032,17 @@ public class API {
|
|||
|
||||
status.setAccount(parseAccountResponse(context, resobj.getJSONObject("account")));
|
||||
status.setContent(resobj.get("content").toString());
|
||||
status.setFavourites_count(Integer.valueOf(resobj.get("favourites_count").toString()));
|
||||
status.setReblogs_count(Integer.valueOf(resobj.get("reblogs_count").toString()));
|
||||
if( !resobj.isNull("favourites_count") ) {
|
||||
status.setFavourites_count(Integer.valueOf(resobj.get("favourites_count").toString()));
|
||||
}else{
|
||||
status.setFavourites_count(0);
|
||||
}
|
||||
if( !resobj.isNull("reblogs_count") ) {
|
||||
status.setReblogs_count(Integer.valueOf(resobj.get("reblogs_count").toString()));
|
||||
}else{
|
||||
status.setReblogs_count(0);
|
||||
}
|
||||
|
||||
try {
|
||||
status.setReplies_count(Integer.valueOf(resobj.get("replies_count").toString()));
|
||||
} catch (Exception e) {
|
||||
|
|
|
@ -742,8 +742,15 @@ public class PixelfedListAdapter extends RecyclerView.Adapter implements OnPostA
|
|||
//popup.getMenu().findItem(R.id.action_mute_conversation).setVisible(false);
|
||||
popup.getMenu().findItem(R.id.action_remove).setVisible(false);
|
||||
//Same instance
|
||||
if (status.getAccount().getAcct().split("@").length < 2)
|
||||
|
||||
if (status.getAccount().getAcct().split("@").length < 2) {
|
||||
popup.getMenu().findItem(R.id.action_block_domain).setVisible(false);
|
||||
}else{
|
||||
String instanceAccount = status.getAccount().getAcct().split("@")[1];
|
||||
if( Helper.getLiveInstance(context).compareTo(instanceAccount) == 0){
|
||||
popup.getMenu().findItem(R.id.action_block_domain).setVisible(false);
|
||||
}
|
||||
}
|
||||
stringArrayConf = context.getResources().getStringArray(R.array.more_action_confirm);
|
||||
}
|
||||
//TODO: fix and display that feature
|
||||
|
@ -754,7 +761,6 @@ public class PixelfedListAdapter extends RecyclerView.Adapter implements OnPostA
|
|||
popup.getMenu().findItem(R.id.action_stats).setVisible(false);
|
||||
popup.getMenu().findItem(R.id.action_translate).setVisible(false);
|
||||
popup.getMenu().findItem(R.id.action_redraft).setVisible(false);
|
||||
popup.getMenu().findItem(R.id.action_block_domain).setVisible(false);
|
||||
popup.getMenu().findItem(R.id.action_bookmark).setVisible(false);
|
||||
|
||||
final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
|
||||
|
|
|
@ -35,6 +35,8 @@ import android.view.View;
|
|||
import android.view.ViewGroup;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -88,7 +90,7 @@ public class DisplayBookmarksFragment extends Fragment implements OnRetrieveFeed
|
|||
|
||||
|
||||
@Override
|
||||
public void onAttach(Context context) {
|
||||
public void onAttach(@NotNull Context context) {
|
||||
super.onAttach(context);
|
||||
this.context = context;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue