get rid of command blicks

This commit is contained in:
kosyak 2024-02-28 22:45:02 +01:00
parent 79c7a3748c
commit c427596107

View file

@ -2038,7 +2038,7 @@ public class ConversationFragment extends XmppFragment
if (activity == null) return; if (activity == null) return;
activity.runOnUiThread(() -> { activity.runOnUiThread(() -> {
refresh(); refresh();
refreshCommands(true); refreshCommands();
}); });
}); });
} }
@ -3060,7 +3060,7 @@ public class ConversationFragment extends XmppFragment
if (commandAdapter != null && conversation != originalConversation) { if (commandAdapter != null && conversation != originalConversation) {
conversation.setupViewPager(binding.conversationViewPager, binding.tabLayout, originalConversation); conversation.setupViewPager(binding.conversationViewPager, binding.tabLayout, originalConversation);
refreshCommands(false); refreshCommands();
} }
if (commandAdapter == null && conversation != null) { if (commandAdapter == null && conversation != null) {
conversation.setupViewPager(binding.conversationViewPager, binding.tabLayout, null); conversation.setupViewPager(binding.conversationViewPager, binding.tabLayout, null);
@ -3072,7 +3072,7 @@ public class ConversationFragment extends XmppFragment
final Element command = commandAdapter.getItem(position); final Element command = commandAdapter.getItem(position);
activity.startCommand(conversation.getAccount(), command.getAttributeAsJid("jid"), command.getAttribute("node")); activity.startCommand(conversation.getAccount(), command.getAttributeAsJid("jid"), command.getAttribute("node"));
}); });
refreshCommands(false); refreshCommands();
} }
replyJumps.clear(); replyJumps.clear();
@ -3081,10 +3081,10 @@ public class ConversationFragment extends XmppFragment
} }
public void refreshForNewCaps() { public void refreshForNewCaps() {
refreshCommands(true); refreshCommands();
} }
protected void refreshCommands(boolean delayShow) { protected void refreshCommands() {
if (commandAdapter == null) return; if (commandAdapter == null) return;
Jid commandJid = conversation.getContact().resourceWhichSupport(Namespace.COMMANDS); Jid commandJid = conversation.getContact().resourceWhichSupport(Namespace.COMMANDS);
@ -3094,7 +3094,6 @@ public class ConversationFragment extends XmppFragment
if (commandJid == null) { if (commandJid == null) {
conversation.hideViewPager(); conversation.hideViewPager();
} else { } else {
if (!delayShow) conversation.showViewPager();
activity.xmppConnectionService.fetchCommands(conversation.getAccount(), commandJid, (a, iq) -> { activity.xmppConnectionService.fetchCommands(conversation.getAccount(), commandJid, (a, iq) -> {
if (activity == null) return; if (activity == null) return;
@ -3110,7 +3109,7 @@ public class ConversationFragment extends XmppFragment
if (commandAdapter.getCount() < 1) { if (commandAdapter.getCount() < 1) {
conversation.hideViewPager(); conversation.hideViewPager();
} else if (delayShow) { } else {
conversation.showViewPager(); conversation.showViewPager();
} }
}); });