Pin can only be done by owner + fixes an issue when query fails

This commit is contained in:
tom79 2017-10-05 07:29:35 +02:00
parent 563bb53f40
commit 0f3c64978f
2 changed files with 34 additions and 35 deletions

View File

@ -718,6 +718,7 @@ public class NotificationsListAdapter extends BaseAdapter implements OnPostActio
boolean show_error_messages = sharedpreferences.getBoolean(Helper.SET_SHOW_ERROR_MESSAGES, true);
if( show_error_messages)
Toast.makeText(context, error.getError(),Toast.LENGTH_LONG).show();
return;
}
Helper.manageMessageStatusCode(context, statusCode, statusAction);
//When muting or blocking an account, its status are removed from the list
@ -730,7 +731,6 @@ public class NotificationsListAdapter extends BaseAdapter implements OnPostActio
notifications.removeAll(notificationsToRemove);
notificationsListAdapter.notifyDataSetChanged();
}
if( targetedId != null) {
if (statusAction == API.StatusAction.REBLOG) {
for (Notification notification : notifications) {
if (notification.getStatus().getId().equals(targetedId)) {
@ -767,7 +767,6 @@ public class NotificationsListAdapter extends BaseAdapter implements OnPostActio
notificationsListAdapter.notifyDataSetChanged();
}
}
}
@Override
public void onPostNotificationsAction(APIResponse apiResponse, Notification notification) {

View File

@ -825,7 +825,7 @@ public class StatusListAdapter extends BaseAdapter implements OnPostActionInterf
holder.status_pin.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
CrossActions.doCrossAction(context, status, (status.isPinned()|| (status.getReblog() != null && status.getReblog().isPinned()))? API.StatusAction.UNPIN:API.StatusAction.PIN, statusListAdapter, StatusListAdapter.this, false);
CrossActions.doCrossAction(context, status, (status.isPinned()|| (status.getReblog() != null && status.getReblog().isPinned()))? API.StatusAction.UNPIN:API.StatusAction.PIN, statusListAdapter, StatusListAdapter.this, true);
}
});