aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/eu/siacs/conversations/services/XmppConnectionService.java')
-rw-r--r--src/main/java/eu/siacs/conversations/services/XmppConnectionService.java14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
index 00729e2b..b08a71bf 100644
--- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
+++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
@@ -224,7 +224,7 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
private OnIqPacketReceived mDefaultIqHandler = new OnIqPacketReceived() {
@Override
public void onIqPacketReceived(Account account, IqPacket packet) {
- if (packet.getType() == IqPacket.TYPE.ERROR) {
+ if (packet.getType() != IqPacket.TYPE.RESULT) {
Element error = packet.findChild("error");
String text = error != null ? error.findChildContent("text") : null;
if (text != null) {
@@ -1675,7 +1675,7 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
sendIqPacket(conversation.getAccount(), request, new OnIqPacketReceived() {
@Override
public void onIqPacketReceived(Account account, IqPacket packet) {
- if (packet.getType() != IqPacket.TYPE.ERROR) {
+ if (packet.getType() == IqPacket.TYPE.RESULT) {
ArrayList<String> features = new ArrayList<>();
for (Element child : packet.query().getChildren()) {
if (child != null && child.getName().equals("feature")) {
@@ -1699,7 +1699,7 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
sendIqPacket(conversation.getAccount(), request, new OnIqPacketReceived() {
@Override
public void onIqPacketReceived(Account account, IqPacket packet) {
- if (packet.getType() != IqPacket.TYPE.ERROR) {
+ if (packet.getType() == IqPacket.TYPE.RESULT) {
Data data = Data.parse(packet.query().findChild("x", "jabber:x:data"));
for (Field field : data.getFields()) {
if (options.containsKey(field.getName())) {
@@ -1713,12 +1713,10 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
sendIqPacket(account, set, new OnIqPacketReceived() {
@Override
public void onIqPacketReceived(Account account, IqPacket packet) {
- if (packet.getType() == IqPacket.TYPE.RESULT) {
- if (callback != null) {
+ if (callback != null) {
+ if (packet.getType() == IqPacket.TYPE.RESULT) {
callback.onPushSucceeded();
- }
- } else {
- if (callback != null) {
+ } else {
callback.onPushFailed();
}
}