mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-13 11:09:39 +02:00
Progress
This commit is contained in:
parent
9da555f57e
commit
6023350364
10 changed files with 212 additions and 116 deletions
|
@ -91,6 +91,7 @@ public abstract class JingleSession implements JingleSessionHandler {
|
|||
|
||||
@Override
|
||||
public IQ handleJingleSessionRequest(Jingle jingle) {
|
||||
try {
|
||||
switch (jingle.getAction()) {
|
||||
case content_accept:
|
||||
return handleContentAccept(jingle);
|
||||
|
@ -121,17 +122,16 @@ public abstract class JingleSession implements JingleSessionHandler {
|
|||
case session_terminate:
|
||||
return handleSessionTerminate(jingle);
|
||||
case transport_replace:
|
||||
try {
|
||||
return handleTransportReplace(jingle);
|
||||
} catch (InterruptedException | SmackException.NoResponseException | SmackException.NotConnectedException | XMPPException.XMPPErrorException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return handleTransportReplace(jingle);
|
||||
default:
|
||||
return IQ.createResultIQ(jingle);
|
||||
}
|
||||
} catch (InterruptedException | XMPPException.XMPPErrorException | SmackException.NotConnectedException | SmackException.NoResponseException e) {
|
||||
return null; //TODO:
|
||||
}
|
||||
}
|
||||
|
||||
protected IQ handleSessionInitiate(Jingle sessionInitiate) {
|
||||
protected IQ handleSessionInitiate(Jingle sessionInitiate) throws InterruptedException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, SmackException.NoResponseException {
|
||||
return IQ.createResultIQ(sessionInitiate);
|
||||
}
|
||||
|
||||
|
@ -143,7 +143,7 @@ public abstract class JingleSession implements JingleSessionHandler {
|
|||
return IQ.createResultIQ(sessionInfo);
|
||||
}
|
||||
|
||||
protected IQ handleSessionAccept(Jingle sessionAccept) {
|
||||
protected IQ handleSessionAccept(Jingle sessionAccept) throws SmackException.NotConnectedException, InterruptedException {
|
||||
return IQ.createResultIQ(sessionAccept);
|
||||
}
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ public final class JingleTransportMethodManager extends Manager {
|
|||
return null;
|
||||
}
|
||||
|
||||
JingleContentTransport transport = content.getJingleTransports().get(0);
|
||||
JingleContentTransport transport = content.getJingleTransport();
|
||||
if (transport == null) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ public class JingleUtil {
|
|||
.setName(contentName)
|
||||
.setSenders(contentSenders)
|
||||
.setDescription(description)
|
||||
.addTransport(transport);
|
||||
.setTransport(transport);
|
||||
|
||||
Jingle jingle = jb.addJingleContent(cb.build()).build();
|
||||
jingle.setFrom(connection.getUser());
|
||||
|
@ -126,7 +126,7 @@ public class JingleUtil {
|
|||
.setName(contentName)
|
||||
.setSenders(contentSenders)
|
||||
.setDescription(description)
|
||||
.addTransport(transport);
|
||||
.setTransport(transport);
|
||||
|
||||
Jingle jingle = jb.addJingleContent(cb.build()).build();
|
||||
jingle.setTo(recipient);
|
||||
|
@ -364,7 +364,7 @@ public class JingleUtil {
|
|||
.setAction(JingleAction.transport_replace);
|
||||
|
||||
JingleContent.Builder cb = JingleContent.getBuilder();
|
||||
cb.setName(contentName).setCreator(contentCreator).addTransport(transport);
|
||||
cb.setName(contentName).setCreator(contentCreator).setTransport(transport);
|
||||
Jingle jingle = jb.addJingleContent(cb.build()).build();
|
||||
|
||||
jingle.setTo(recipient);
|
||||
|
@ -391,7 +391,7 @@ public class JingleUtil {
|
|||
.setSessionId(sessionId);
|
||||
|
||||
JingleContent.Builder cb = JingleContent.getBuilder();
|
||||
cb.setCreator(contentCreator).setName(contentName).addTransport(transport);
|
||||
cb.setCreator(contentCreator).setName(contentName).setTransport(transport);
|
||||
|
||||
Jingle jingle = jb.addJingleContent(cb.build()).build();
|
||||
jingle.setTo(recipient);
|
||||
|
@ -418,7 +418,7 @@ public class JingleUtil {
|
|||
.setSessionId(sessionId);
|
||||
|
||||
JingleContent.Builder cb = JingleContent.getBuilder();
|
||||
cb.setCreator(contentCreator).setName(contentName).addTransport(transport);
|
||||
cb.setCreator(contentCreator).setName(contentName).setTransport(transport);
|
||||
|
||||
Jingle jingle = jb.addJingleContent(cb.build()).build();
|
||||
jingle.setTo(recipient);
|
||||
|
|
|
@ -1,3 +1,19 @@
|
|||
/**
|
||||
*
|
||||
* Copyright 2017 Paul Schaub
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.jivesoftware.smackx.jingle.transports;
|
||||
|
||||
import org.jivesoftware.smackx.bytestreams.BytestreamSession;
|
||||
|
|
|
@ -1,3 +1,19 @@
|
|||
/**
|
||||
*
|
||||
* Copyright 2017 Paul Schaub
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.jivesoftware.smackx.jingle.transports;
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue