diff options
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/pixart/messenger/parser/AbstractParser.java | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/main/java/de/pixart/messenger/parser/AbstractParser.java b/src/main/java/de/pixart/messenger/parser/AbstractParser.java index 283aee7af..50204cb7b 100644 --- a/src/main/java/de/pixart/messenger/parser/AbstractParser.java +++ b/src/main/java/de/pixart/messenger/parser/AbstractParser.java @@ -10,9 +10,8 @@ import de.pixart.messenger.entities.Conversation; import de.pixart.messenger.entities.MucOptions; import de.pixart.messenger.services.XmppConnectionService; import de.pixart.messenger.xml.Element; -import de.pixart.messenger.xmpp.jid.InvalidJidException; -import de.pixart.messenger.xmpp.jid.Jid; import de.pixart.messenger.xmpp.stanzas.AbstractStanza; +import rocks.xmpp.addr.Jid; public abstract class AbstractParser { @@ -38,7 +37,7 @@ public abstract class AbstractParser { for (Element child : element.getChildren()) { if ("delay".equals(child.getName()) && "urn:xmpp:delay".equals(child.getNamespace())) { final Jid f = to == null ? null : child.getAttributeAsJid("from"); - if (f != null && (to.toBareJid().equals(f) || to.getDomainpart().equals(f.toString()))) { + if (f != null && (to.asBareJid().equals(f) || to.getDomain().equals(f.toString()))) { continue; } final String stamp = child.getAttribute("stamp"); @@ -85,7 +84,7 @@ public abstract class AbstractParser { protected void updateLastseen(final Account account, final Jid from) { final Contact contact = account.getRoster().getContact(from); - contact.setLastResource(from.isBareJid() ? "" : from.getResourcepart()); + contact.setLastResource(from.isBareJid() ? "" : from.getResource()); } protected String avatarData(Element items) { @@ -101,15 +100,15 @@ public abstract class AbstractParser { } public static MucOptions.User parseItem(Conversation conference, Element item, Jid fullJid) { - final String local = conference.getJid().getLocalpart(); - final String domain = conference.getJid().getDomainpart(); + final String local = conference.getJid().getLocal(); + final String domain = conference.getJid().getDomain(); String affiliation = item.getAttribute("affiliation"); String role = item.getAttribute("role"); String nick = item.getAttribute("nick"); if (nick != null && fullJid == null) { try { - fullJid = Jid.fromParts(local, domain, nick); - } catch (InvalidJidException e) { + fullJid = Jid.of(local, domain, nick); + } catch (IllegalArgumentException e) { fullJid = null; } } |