aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/xmpp/jingle/stanzas/JinglePacket.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/de/pixart/messenger/xmpp/jingle/stanzas/JinglePacket.java')
-rw-r--r--src/main/java/de/pixart/messenger/xmpp/jingle/stanzas/JinglePacket.java150
1 files changed, 75 insertions, 75 deletions
diff --git a/src/main/java/de/pixart/messenger/xmpp/jingle/stanzas/JinglePacket.java b/src/main/java/de/pixart/messenger/xmpp/jingle/stanzas/JinglePacket.java
index 971ab8e1b..de856772a 100644
--- a/src/main/java/de/pixart/messenger/xmpp/jingle/stanzas/JinglePacket.java
+++ b/src/main/java/de/pixart/messenger/xmpp/jingle/stanzas/JinglePacket.java
@@ -5,92 +5,92 @@ import de.pixart.messenger.xmpp.jid.Jid;
import de.pixart.messenger.xmpp.stanzas.IqPacket;
public class JinglePacket extends IqPacket {
- Content content = null;
- Reason reason = null;
- Element jingle = new Element("jingle");
+ Content content = null;
+ Reason reason = null;
+ Element jingle = new Element("jingle");
- @Override
- public Element addChild(Element child) {
- if ("jingle".equals(child.getName())) {
- Element contentElement = child.findChild("content");
- if (contentElement != null) {
- this.content = new Content();
- this.content.setChildren(contentElement.getChildren());
- this.content.setAttributes(contentElement.getAttributes());
- }
- Element reasonElement = child.findChild("reason");
- if (reasonElement != null) {
- this.reason = new Reason();
- this.reason.setChildren(reasonElement.getChildren());
- this.reason.setAttributes(reasonElement.getAttributes());
- }
- this.jingle.setAttributes(child.getAttributes());
- }
- return child;
- }
+ @Override
+ public Element addChild(Element child) {
+ if ("jingle".equals(child.getName())) {
+ Element contentElement = child.findChild("content");
+ if (contentElement != null) {
+ this.content = new Content();
+ this.content.setChildren(contentElement.getChildren());
+ this.content.setAttributes(contentElement.getAttributes());
+ }
+ Element reasonElement = child.findChild("reason");
+ if (reasonElement != null) {
+ this.reason = new Reason();
+ this.reason.setChildren(reasonElement.getChildren());
+ this.reason.setAttributes(reasonElement.getAttributes());
+ }
+ this.jingle.setAttributes(child.getAttributes());
+ }
+ return child;
+ }
- public JinglePacket setContent(Content content) {
- this.content = content;
- return this;
- }
+ public JinglePacket setContent(Content content) {
+ this.content = content;
+ return this;
+ }
- public Content getJingleContent() {
- if (this.content == null) {
- this.content = new Content();
- }
- return this.content;
- }
+ public Content getJingleContent() {
+ if (this.content == null) {
+ this.content = new Content();
+ }
+ return this.content;
+ }
- public JinglePacket setReason(Reason reason) {
- this.reason = reason;
- return this;
- }
+ public JinglePacket setReason(Reason reason) {
+ this.reason = reason;
+ return this;
+ }
- public Reason getReason() {
- return this.reason;
- }
+ public Reason getReason() {
+ return this.reason;
+ }
- private void build() {
- this.children.clear();
- this.jingle.clearChildren();
- this.jingle.setAttribute("xmlns", "urn:xmpp:jingle:1");
- if (this.content != null) {
- jingle.addChild(this.content);
- }
- if (this.reason != null) {
- jingle.addChild(this.reason);
- }
- this.children.add(jingle);
- this.setAttribute("type", "set");
- }
+ private void build() {
+ this.children.clear();
+ this.jingle.clearChildren();
+ this.jingle.setAttribute("xmlns", "urn:xmpp:jingle:1");
+ if (this.content != null) {
+ jingle.addChild(this.content);
+ }
+ if (this.reason != null) {
+ jingle.addChild(this.reason);
+ }
+ this.children.add(jingle);
+ this.setAttribute("type", "set");
+ }
- public String getSessionId() {
- return this.jingle.getAttribute("sid");
- }
+ public String getSessionId() {
+ return this.jingle.getAttribute("sid");
+ }
- public void setSessionId(String sid) {
- this.jingle.setAttribute("sid", sid);
- }
+ public void setSessionId(String sid) {
+ this.jingle.setAttribute("sid", sid);
+ }
- @Override
- public String toString() {
- this.build();
- return super.toString();
- }
+ @Override
+ public String toString() {
+ this.build();
+ return super.toString();
+ }
- public void setAction(String action) {
- this.jingle.setAttribute("action", action);
- }
+ public void setAction(String action) {
+ this.jingle.setAttribute("action", action);
+ }
- public String getAction() {
- return this.jingle.getAttribute("action");
- }
+ public String getAction() {
+ return this.jingle.getAttribute("action");
+ }
- public void setInitiator(final Jid initiator) {
- this.jingle.setAttribute("initiator", initiator.toString());
- }
+ public void setInitiator(final Jid initiator) {
+ this.jingle.setAttribute("initiator", initiator.toString());
+ }
- public boolean isAction(String action) {
- return action.equalsIgnoreCase(this.getAction());
- }
+ public boolean isAction(String action) {
+ return action.equalsIgnoreCase(this.getAction());
+ }
}