From ec6220969d362195630c17ec472bcb225838e9ae Mon Sep 17 00:00:00 2001 From: Gayaz Yusipov Date: Sat, 30 Aug 2014 14:26:46 +0400 Subject: XEP-0172 --- src/eu/siacs/conversations/parser/PresenceParser.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/eu/siacs/conversations/parser/PresenceParser.java b/src/eu/siacs/conversations/parser/PresenceParser.java index ea19df6f..5e5501dd 100644 --- a/src/eu/siacs/conversations/parser/PresenceParser.java +++ b/src/eu/siacs/conversations/parser/PresenceParser.java @@ -49,7 +49,7 @@ public class PresenceParser extends AbstractParser implements if (packet.getFrom() == null) { return; } - String[] fromParts = packet.getFrom().split("/"); + String[] fromParts = packet.getFrom().split("/", 2); String type = packet.getAttribute("type"); if (fromParts[0].equals(account.getJid())) { if (fromParts.length == 2) { @@ -60,7 +60,6 @@ public class PresenceParser extends AbstractParser implements account.removePresence(fromParts[1]); } } - } else { Contact contact = account.getRoster().getContact(packet.getFrom()); if (type == null) { @@ -108,6 +107,10 @@ public class PresenceParser extends AbstractParser implements contact.setOption(Contact.Options.PENDING_SUBSCRIPTION_REQUEST); } } + Element nick = packet.findChild("nick", "http://jabber.org/protocol/nick"); + if (nick != null) { + contact.setSystemName(nick.getContent()); + } } mXmppConnectionService.updateRosterUi(); } -- cgit v1.2.3