aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ConversationActivity.java8
-rw-r--r--src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java8
2 files changed, 5 insertions, 11 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
index 0f9761e5..5b0fa562 100644
--- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
@@ -771,12 +771,8 @@ public class ConversationActivity extends XmppActivity implements
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == RESULT_OK) {
if (requestCode == REQUEST_DECRYPT_PGP) {
- ConversationFragment selectedFragment = (ConversationFragment) getFragmentManager()
- .findFragmentByTag("conversation");
- if (selectedFragment != null) {
- selectedFragment.hideSnackbar();
- selectedFragment.updateMessages();
- }
+ mConversationFragment.hideSnackbar();
+ mConversationFragment.updateMessages();
} else if (requestCode == REQUEST_ATTACH_IMAGE_DIALOG) {
mPendingImageUri = data.getData();
if (xmppConnectionServiceBound) {
diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
index 2f5994c4..fb151427 100644
--- a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
+++ b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
@@ -848,11 +848,9 @@ public class XmppConnection implements Runnable {
List<Element> elements = packet.query().getChildren();
for (Element element : elements) {
if (element.getName().equals("item")) {
- final String jid = element.getAttribute("jid");
- try {
- sendServiceDiscoveryInfo(Jid.fromString(jid).toDomainJid());
- } catch (final InvalidJidException ignored) {
- // TODO: Handle the case where an external JID is technically invalid?
+ final Jid jid = element.getAttributeAsJid("jid");
+ if (jid != null && !jid.equals(account.getServer())) {
+ sendServiceDiscoveryInfo(jid);
}
}
}