s/getResourcepart().isEmpty()/isBareJid()/

This commit is contained in:
Sam Whited 2014-11-09 13:13:19 -05:00
parent 56b4ac1751
commit 385bea0fe3
5 changed files with 7 additions and 7 deletions

View file

@ -83,7 +83,7 @@ public class Account extends AbstractEntity {
final String avatar) { final String avatar) {
this.uuid = uuid; this.uuid = uuid;
this.jid = jid; this.jid = jid;
if (jid.getResourcepart().isEmpty()) { if (jid.isBareJid()) {
this.setResource("mobile"); this.setResource("mobile");
} }
this.password = password; this.password = password;

View file

@ -244,7 +244,7 @@ public class MucOptions {
&& conversation.getBookmark().getNick() != null) { && conversation.getBookmark().getNick() != null) {
return conversation.getBookmark().getNick(); return conversation.getBookmark().getNick();
} else { } else {
if (!conversation.getContactJid().getResourcepart().isEmpty()) { if (!conversation.getContactJid().isBareJid()) {
return conversation.getContactJid().getResourcepart(); return conversation.getContactJid().getResourcepart();
} else { } else {
return account.getUsername(); return account.getUsername();
@ -376,4 +376,4 @@ public class MucOptions {
public Conversation getConversation() { public Conversation getConversation() {
return this.conversation; return this.conversation;
} }
} }

View file

@ -69,7 +69,7 @@ public abstract class AbstractParser {
// TODO: Handle this? // TODO: Handle this?
from = null; from = null;
} }
String presence = from == null || from.getResourcepart().isEmpty() ? "" : from.getResourcepart(); String presence = from == null || from.isBareJid() ? "" : from.getResourcepart();
Contact contact = account.getRoster().getContact(from); Contact contact = account.getRoster().getContact(from);
long timestamp = getTimestamp(packet); long timestamp = getTimestamp(packet);
if (timestamp >= contact.lastseen.time) { if (timestamp >= contact.lastseen.time) {

View file

@ -40,7 +40,7 @@ public class MessageParser extends AbstractParser implements
finishedMessage.setRemoteMsgId(packet.getId()); finishedMessage.setRemoteMsgId(packet.getId());
finishedMessage.markable = isMarkable(packet); finishedMessage.markable = isMarkable(packet);
if (conversation.getMode() == Conversation.MODE_MULTI if (conversation.getMode() == Conversation.MODE_MULTI
&& !jid.getResourcepart().isEmpty()) { && !jid.isBareJid()) {
finishedMessage.setType(Message.TYPE_PRIVATE); finishedMessage.setType(Message.TYPE_PRIVATE);
finishedMessage.setCounterpart(packet.getFrom()); finishedMessage.setCounterpart(packet.getFrom());
finishedMessage.setTrueCounterpart(conversation.getMucOptions() finishedMessage.setTrueCounterpart(conversation.getMucOptions()

View file

@ -56,7 +56,7 @@ public class PresenceParser extends AbstractParser implements
final Jid from = packet.getFrom(); final Jid from = packet.getFrom();
String type = packet.getAttribute("type"); String type = packet.getAttribute("type");
if (from.toBareJid().equals(account.getJid().toBareJid())) { if (from.toBareJid().equals(account.getJid().toBareJid())) {
if (!from.getResourcepart().isEmpty()) { if (!from.isBareJid()) {
if (type == null) { if (type == null) {
account.updatePresence(from.getResourcepart(), account.updatePresence(from.getResourcepart(),
Presences.parseShow(packet.findChild("show"))); Presences.parseShow(packet.findChild("show")));
@ -69,7 +69,7 @@ public class PresenceParser extends AbstractParser implements
Contact contact = account.getRoster().getContact(packet.getFrom()); Contact contact = account.getRoster().getContact(packet.getFrom());
if (type == null) { if (type == null) {
String presence; String presence;
if (!from.getResourcepart().isEmpty()) { if (!from.isBareJid()) {
presence = from.getResourcepart(); presence = from.getResourcepart();
} else { } else {
presence = ""; presence = "";