1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-12-23 04:57:58 +01:00

[SPARK-651] - More Message Improvements

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@7910 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Thiago Camargo 2007-04-06 16:43:22 +00:00 committed by thiago
parent 241ae7c276
commit b695257f76
2 changed files with 12 additions and 3 deletions

View file

@ -1154,17 +1154,26 @@ public abstract class JingleSession extends JingleNegotiator implements MediaRec
public abstract void start(JingleSessionRequest jin) throws XMPPException;
/**
* Terminate the session.
* Terminates the session with default reason.
*
* @throws XMPPException
*/
public void terminate() throws XMPPException {
terminate("Closed Locally");
}
/**
* Terminates the session with a custom reason.
*
* @throws XMPPException
*/
public void terminate(String reason) throws XMPPException {
if (isClosed()) return;
System.out.println("State: " + this.getState());
Jingle jout = new Jingle(Jingle.Action.SESSIONTERMINATE);
jout.setType(IQ.Type.SET);
sendFormattedJingle(jout);
triggerSessionClosed("Closed Locally");
triggerSessionClosed(reason);
}
/**

View file

@ -361,7 +361,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
if (getState() == null || !getState().equals(active)) {
try {
session.terminate();
session.terminate("Unable to negotiate session. This may be caused by firewall configuration problems.");
}
catch (XMPPException e) {
e.printStackTrace();