some improvements

This commit is contained in:
Thomas 2022-10-29 16:35:15 +02:00
parent 345ed2afd6
commit ec77f4b7b6
2 changed files with 5 additions and 2 deletions

View file

@ -1662,6 +1662,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
popup.getMenu().findItem(R.id.action_report).setVisible(false);
popup.getMenu().findItem(R.id.action_timed_mute).setVisible(false);
popup.getMenu().findItem(R.id.action_block_domain).setVisible(false);
popup.getMenu().findItem(R.id.action_pin).setVisible(!statusToDeal.visibility.equalsIgnoreCase("direct"));
stringArrayConf = context.getResources().getStringArray(R.array.more_action_owner_confirm);
} else {
popup.getMenu().findItem(R.id.action_pin).setVisible(false);
@ -1768,9 +1769,9 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
return true;
} else if (itemId == R.id.action_pin) {
if (statusToDeal.pinned) {
statusesVM.unPin(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, statusToDeal.id).observe((LifecycleOwner) context, status1 -> Toasty.info(context, context.getString(R.string.toast_unmute_conversation)).show());
statusesVM.unPin(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, statusToDeal.id).observe((LifecycleOwner) context, status1 -> Toasty.info(context, context.getString(R.string.toast_unpin)).show());
} else {
statusesVM.pin(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, statusToDeal.id).observe((LifecycleOwner) context, status1 -> Toasty.info(context, context.getString(R.string.toast_mute_conversation)).show());
statusesVM.pin(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, statusToDeal.id).observe((LifecycleOwner) context, status1 -> Toasty.info(context, context.getString(R.string.toast_pin)).show());
}
return true;
} else if (itemId == R.id.action_bookmark) {

View file

@ -1515,4 +1515,6 @@
<string name="change_logo_description">Change the logo of the app on your device</string>
<string name="action_pin">Pin message</string>
<string name="action_unpin">Unpin message</string>
<string name="toast_unpin">The message is no longer pinned!</string>
<string name="toast_pin">The message has been pinned</string>
</resources>