aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu
diff options
context:
space:
mode:
authorSam Whited <sam@samwhited.com>2014-11-09 13:13:19 -0500
committerSam Whited <sam@samwhited.com>2014-11-09 13:13:19 -0500
commit385bea0fe364d5a9ab7d4a13b5c93eb46016ea9d (patch)
treec5b4af4db8a5305fecb0b863d38aa0835c1947b3 /src/main/java/eu
parent56b4ac17517c37afa09c65239687a47c1a7c0f5b (diff)
s/getResourcepart().isEmpty()/isBareJid()/
Diffstat (limited to 'src/main/java/eu')
-rw-r--r--src/main/java/eu/siacs/conversations/entities/Account.java2
-rw-r--r--src/main/java/eu/siacs/conversations/entities/MucOptions.java4
-rw-r--r--src/main/java/eu/siacs/conversations/parser/AbstractParser.java2
-rw-r--r--src/main/java/eu/siacs/conversations/parser/MessageParser.java2
-rw-r--r--src/main/java/eu/siacs/conversations/parser/PresenceParser.java4
5 files changed, 7 insertions, 7 deletions
diff --git a/src/main/java/eu/siacs/conversations/entities/Account.java b/src/main/java/eu/siacs/conversations/entities/Account.java
index bceec639..8b6a7bd7 100644
--- a/src/main/java/eu/siacs/conversations/entities/Account.java
+++ b/src/main/java/eu/siacs/conversations/entities/Account.java
@@ -83,7 +83,7 @@ public class Account extends AbstractEntity {
final String avatar) {
this.uuid = uuid;
this.jid = jid;
- if (jid.getResourcepart().isEmpty()) {
+ if (jid.isBareJid()) {
this.setResource("mobile");
}
this.password = password;
diff --git a/src/main/java/eu/siacs/conversations/entities/MucOptions.java b/src/main/java/eu/siacs/conversations/entities/MucOptions.java
index 166b6b68..e25c6b89 100644
--- a/src/main/java/eu/siacs/conversations/entities/MucOptions.java
+++ b/src/main/java/eu/siacs/conversations/entities/MucOptions.java
@@ -244,7 +244,7 @@ public class MucOptions {
&& conversation.getBookmark().getNick() != null) {
return conversation.getBookmark().getNick();
} else {
- if (!conversation.getContactJid().getResourcepart().isEmpty()) {
+ if (!conversation.getContactJid().isBareJid()) {
return conversation.getContactJid().getResourcepart();
} else {
return account.getUsername();
@@ -376,4 +376,4 @@ public class MucOptions {
public Conversation getConversation() {
return this.conversation;
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/eu/siacs/conversations/parser/AbstractParser.java b/src/main/java/eu/siacs/conversations/parser/AbstractParser.java
index 9e413052..eedfca16 100644
--- a/src/main/java/eu/siacs/conversations/parser/AbstractParser.java
+++ b/src/main/java/eu/siacs/conversations/parser/AbstractParser.java
@@ -69,7 +69,7 @@ public abstract class AbstractParser {
// TODO: Handle this?
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);
long timestamp = getTimestamp(packet);
if (timestamp >= contact.lastseen.time) {
diff --git a/src/main/java/eu/siacs/conversations/parser/MessageParser.java b/src/main/java/eu/siacs/conversations/parser/MessageParser.java
index e4ae2701..c68a6b23 100644
--- a/src/main/java/eu/siacs/conversations/parser/MessageParser.java
+++ b/src/main/java/eu/siacs/conversations/parser/MessageParser.java
@@ -40,7 +40,7 @@ public class MessageParser extends AbstractParser implements
finishedMessage.setRemoteMsgId(packet.getId());
finishedMessage.markable = isMarkable(packet);
if (conversation.getMode() == Conversation.MODE_MULTI
- && !jid.getResourcepart().isEmpty()) {
+ && !jid.isBareJid()) {
finishedMessage.setType(Message.TYPE_PRIVATE);
finishedMessage.setCounterpart(packet.getFrom());
finishedMessage.setTrueCounterpart(conversation.getMucOptions()
diff --git a/src/main/java/eu/siacs/conversations/parser/PresenceParser.java b/src/main/java/eu/siacs/conversations/parser/PresenceParser.java
index bd487c79..635f2932 100644
--- a/src/main/java/eu/siacs/conversations/parser/PresenceParser.java
+++ b/src/main/java/eu/siacs/conversations/parser/PresenceParser.java
@@ -56,7 +56,7 @@ public class PresenceParser extends AbstractParser implements
final Jid from = packet.getFrom();
String type = packet.getAttribute("type");
if (from.toBareJid().equals(account.getJid().toBareJid())) {
- if (!from.getResourcepart().isEmpty()) {
+ if (!from.isBareJid()) {
if (type == null) {
account.updatePresence(from.getResourcepart(),
Presences.parseShow(packet.findChild("show")));
@@ -69,7 +69,7 @@ public class PresenceParser extends AbstractParser implements
Contact contact = account.getRoster().getContact(packet.getFrom());
if (type == null) {
String presence;
- if (!from.getResourcepart().isEmpty()) {
+ if (!from.isBareJid()) {
presence = from.getResourcepart();
} else {
presence = "";