aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/parser/PresenceParser.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/eu/siacs/conversations/parser/PresenceParser.java')
-rw-r--r--src/eu/siacs/conversations/parser/PresenceParser.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/eu/siacs/conversations/parser/PresenceParser.java b/src/eu/siacs/conversations/parser/PresenceParser.java
index ea19df6f..05ffa67e 100644
--- a/src/eu/siacs/conversations/parser/PresenceParser.java
+++ b/src/eu/siacs/conversations/parser/PresenceParser.java
@@ -26,7 +26,7 @@ public class PresenceParser extends AbstractParser implements
if (muc != null) {
boolean before = muc.getMucOptions().online();
muc.getMucOptions().processPacket(packet, mPgpEngine);
- if (before!=muc.getMucOptions().online()) {
+ if (before != muc.getMucOptions().online()) {
mXmppConnectionService.updateConversationUi();
}
}
@@ -36,7 +36,7 @@ public class PresenceParser extends AbstractParser implements
if (muc != null) {
boolean before = muc.getMucOptions().online();
muc.getMucOptions().processPacket(packet, mPgpEngine);
- if (before!=muc.getMucOptions().online()) {
+ if (before != muc.getMucOptions().online()) {
mXmppConnectionService.updateConversationUi();
}
}
@@ -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,11 @@ 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.setPresenceName(nick.getContent());
+ }
}
mXmppConnectionService.updateRosterUi();
}