aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2019-05-04 15:59:04 +0200
committerChristian Schneppe <christian@pix-art.de>2019-05-04 15:59:04 +0200
commitba03ee41a83d33ed8550633f9e48eb5808cc8bf8 (patch)
tree23cb05ac7ab6a7859196d9b944039b7f97fea79e /src
parentb64ef37906e7b2e51857e73ec61eedfcb79ba4e8 (diff)
Make use of Namespace.REGISTER constant
Diffstat (limited to 'src')
-rw-r--r--src/main/java/de/pixart/messenger/generator/IqGenerator.java2
-rw-r--r--src/main/java/de/pixart/messenger/xmpp/XmppConnection.java8
2 files changed, 5 insertions, 5 deletions
diff --git a/src/main/java/de/pixart/messenger/generator/IqGenerator.java b/src/main/java/de/pixart/messenger/generator/IqGenerator.java
index 024e7ab43..16e585a18 100644
--- a/src/main/java/de/pixart/messenger/generator/IqGenerator.java
+++ b/src/main/java/de/pixart/messenger/generator/IqGenerator.java
@@ -425,7 +425,7 @@ public class IqGenerator extends AbstractGenerator {
register.setFrom(account.getJid().asBareJid());
register.setTo(Jid.of(account.getServer()));
register.setId(id);
- Element query = register.query("jabber:iq:register");
+ Element query = register.query(Namespace.REGISTER);
if (data != null) {
query.addChild(data);
}
diff --git a/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java b/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java
index 5effa386d..8e5eaf673 100644
--- a/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java
+++ b/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java
@@ -949,7 +949,7 @@ public class XmppConnection implements Runnable {
private void sendRegistryRequest() {
final IqPacket register = new IqPacket(IqPacket.TYPE.GET);
- register.query("jabber:iq:register");
+ register.query(Namespace.REGISTER);
register.setTo(Jid.of(account.getServer()));
sendUnmodifiedIqPacket(register, (account, packet) -> {
if (packet.getType() == IqPacket.TYPE.TIMEOUT) {
@@ -958,12 +958,12 @@ public class XmppConnection implements Runnable {
if (packet.getType() == IqPacket.TYPE.ERROR) {
throw new StateChangingError(Account.State.REGISTRATION_FAILED);
}
- final Element query = packet.query("jabber:iq:register");
+ final Element query = packet.query(Namespace.REGISTER);
if (query.hasChild("username") && (query.hasChild("password"))) {
final IqPacket register1 = new IqPacket(IqPacket.TYPE.SET);
final Element username = new Element("username").setContent(account.getUsername());
final Element password = new Element("password").setContent(account.getPassword());
- register1.query("jabber:iq:register").addChild(username);
+ register1.query(Namespace.REGISTER).addChild(username);
register1.query().addChild(password);
register1.setFrom(account.getJid().asBareJid());
sendUnmodifiedIqPacket(register1, registrationResponseListener, true);
@@ -1019,7 +1019,7 @@ public class XmppConnection implements Runnable {
public void sendDeleteRequest() {
final IqPacket delete = new IqPacket(IqPacket.TYPE.SET);
- delete.query("jabber:iq:register").addChild("remove");
+ delete.query(Namespace.REGISTER).addChild("remove");
delete.setTo(Jid.of(account.getServer()));
delete.setFrom(account.getJid().asBareJid());
sendUnmodifiedIqPacket(delete, (account, packet) -> {