only delivery get and set iq packets to unhandled iq listener. only create jingle packets with type=get or set

This commit is contained in:
iNPUTmice 2014-10-05 14:26:06 +02:00
parent b0574b289f
commit 6b3097ee27

View file

@ -166,10 +166,12 @@ public class XmppConnection implements Runnable {
+ ":" + srvRecordPort);
socket = new Socket(srvRecordServer, srvRecordPort);
}
} else if (namePort.containsKey("error") && "nosrv".equals(namePort.getString("error", null))) {
} else if (namePort.containsKey("error")
&& "nosrv".equals(namePort.getString("error", null))) {
socket = new Socket(account.getServer(), 5222);
} else {
Log.d(Config.LOGTAG,account.getJid()+": timeout in DNS resolution");
Log.d(Config.LOGTAG, account.getJid()
+ ": timeout in DNS resolution");
changeStatus(Account.STATUS_OFFLINE);
return;
}
@ -362,7 +364,8 @@ public class XmppConnection implements Runnable {
@Override
public void onIqPacketReceived(Account account, IqPacket packet) {
Log.d(Config.LOGTAG,account.getJid()+": online with resource "+account.getResource());
Log.d(Config.LOGTAG, account.getJid()
+ ": online with resource " + account.getResource());
changeStatus(Account.STATUS_ONLINE);
}
});
@ -392,8 +395,11 @@ public class XmppConnection implements Runnable {
while (!nextTag.isEnd(element.getName())) {
if (!nextTag.isNo()) {
Element child = tagReader.readElement(nextTag);
if ((packetType == PACKET_IQ)
&& ("jingle".equals(child.getName()))) {
String type = currentTag.getAttribute("type");
if (packetType == PACKET_IQ
&& "jingle".equals(child.getName())
&& ("set".equalsIgnoreCase(type) || "get"
.equalsIgnoreCase(type))) {
element = new JinglePacket();
element.setAttributes(currentTag.getAttributes());
}
@ -430,7 +436,9 @@ public class XmppConnection implements Runnable {
}
packetCallbacks.remove(packet.getId());
} else if (this.unregisteredIqListener != null) {
} else if ((packet.getType() == IqPacket.TYPE_GET || packet
.getType() == IqPacket.TYPE_SET)
&& this.unregisteredIqListener != null) {
this.unregisteredIqListener.onIqPacketReceived(account, packet);
}
}