refresh gets called too often, only refresh commands on demand

Stephen Paul Weber created

But do still call a full refresh on manual service discovery.

Change summary

src/main/java/eu/siacs/conversations/ui/ConversationFragment.java | 6 
1 file changed, 4 insertions(+), 2 deletions(-)

Detailed changes

src/main/java/eu/siacs/conversations/ui/ConversationFragment.java 🔗

@@ -1578,7 +1578,10 @@ public class ConversationFragment extends XmppFragment
             if (!entry.getKey().equals("")) jid = jid.withResource(entry.getKey());
             activity.xmppConnectionService.fetchCaps(conversation.getAccount(), jid, entry.getValue(), () -> {
                 if (activity == null) return;
-                activity.runOnUiThread(() -> { refresh(); });
+                activity.runOnUiThread(() -> {
+                    refresh();
+                    refreshCommands();
+                });
             });
         }
     }
@@ -2868,7 +2871,6 @@ public class ConversationFragment extends XmppFragment
                 }
                 updateSendButton();
                 updateEditablity();
-                refreshCommands();
             }
         }
     }