mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-23 06:42:05 +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:
parent
241ae7c276
commit
b695257f76
2 changed files with 12 additions and 3 deletions
|
@ -1154,17 +1154,26 @@ public abstract class JingleSession extends JingleNegotiator implements MediaRec
|
||||||
public abstract void start(JingleSessionRequest jin) throws XMPPException;
|
public abstract void start(JingleSessionRequest jin) throws XMPPException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Terminate the session.
|
* Terminates the session with default reason.
|
||||||
*
|
*
|
||||||
* @throws XMPPException
|
* @throws XMPPException
|
||||||
*/
|
*/
|
||||||
public void terminate() 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;
|
if (isClosed()) return;
|
||||||
System.out.println("State: " + this.getState());
|
System.out.println("State: " + this.getState());
|
||||||
Jingle jout = new Jingle(Jingle.Action.SESSIONTERMINATE);
|
Jingle jout = new Jingle(Jingle.Action.SESSIONTERMINATE);
|
||||||
jout.setType(IQ.Type.SET);
|
jout.setType(IQ.Type.SET);
|
||||||
sendFormattedJingle(jout);
|
sendFormattedJingle(jout);
|
||||||
triggerSessionClosed("Closed Locally");
|
triggerSessionClosed(reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -361,7 +361,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
|
||||||
|
|
||||||
if (getState() == null || !getState().equals(active)) {
|
if (getState() == null || !getState().equals(active)) {
|
||||||
try {
|
try {
|
||||||
session.terminate();
|
session.terminate("Unable to negotiate session. This may be caused by firewall configuration problems.");
|
||||||
}
|
}
|
||||||
catch (XMPPException e) {
|
catch (XMPPException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
Loading…
Reference in a new issue