aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/xmpp/jingle/JingleConnection.java
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-04-10 14:12:08 +0200
committerDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-04-10 14:12:08 +0200
commit644473205ab261157f500470d496999db665d75f (patch)
treeca059f9b294bfaa79c6ed8dfb3d6fedddcaecf06 /src/eu/siacs/conversations/xmpp/jingle/JingleConnection.java
parentba0bedc5facabc573023925660d7d49b27d5c68c (diff)
incomming jingle packets are routed to their connection. added presence chooser in gui
Diffstat (limited to 'src/eu/siacs/conversations/xmpp/jingle/JingleConnection.java')
-rw-r--r--src/eu/siacs/conversations/xmpp/jingle/JingleConnection.java27
1 files changed, 25 insertions, 2 deletions
diff --git a/src/eu/siacs/conversations/xmpp/jingle/JingleConnection.java b/src/eu/siacs/conversations/xmpp/jingle/JingleConnection.java
index 60ba0291..e8f5aa22 100644
--- a/src/eu/siacs/conversations/xmpp/jingle/JingleConnection.java
+++ b/src/eu/siacs/conversations/xmpp/jingle/JingleConnection.java
@@ -19,6 +19,11 @@ public class JingleConnection {
private JingleConnectionManager mJingleConnectionManager;
private XmppConnectionService mXmppConnectionService;
+ public static final int STATUS_INITIATED = 0;
+ public static final int STATUS_ACCEPTED = 1;
+ public static final int STATUS_FAILED = 99;
+
+ private int status = -1;
private Message message;
private String sessionId;
private Account account;
@@ -30,7 +35,9 @@ public class JingleConnection {
@Override
public void onIqPacketReceived(Account account, IqPacket packet) {
- Log.d("xmppService",packet.toString());
+ if (packet.getType() == IqPacket.TYPE_ERROR) {
+ status = STATUS_FAILED;
+ }
}
};
@@ -44,6 +51,21 @@ public class JingleConnection {
return this.sessionId;
}
+ public String getAccountJid() {
+ return this.account.getJid();
+ }
+
+ public String getCounterPart() {
+ return this.message.getCounterpart();
+ }
+
+ public void deliverPacket(JinglePacket packet) {
+ Log.d("xmppService","packet arrived in connection");
+ if (packet.isAction("")) {
+
+ }
+ }
+
public void init(Message message) {
this.message = message;
this.account = message.getConversation().getAccount();
@@ -78,13 +100,14 @@ public class JingleConnection {
packet.setContent(content);
Log.d("xmppService",packet.toString());
account.getXmppConnection().sendIqPacket(packet, this.responseListener);
+ this.status = STATUS_INITIATED;
}
}
private JinglePacket bootstrapPacket() {
JinglePacket packet = new JinglePacket();
packet.setFrom(account.getFullJid());
- packet.setTo(this.message.getCounterpart()+"/Gajim"); //fixme, not right in all cases;
+ packet.setTo(this.message.getCounterpart()); //fixme, not right in all cases;
packet.setSessionId(this.sessionId);
return packet;
}