mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-28 11:42:15 -05:00
Merge pull request #644 from SamWhited/barejidchecks
s/getResourcepart().isEmpty()/isBareJid()/ [EOM]
This commit is contained in:
commit
a45a343604
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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) {
|
||||
|
@ -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()
|
||||
|
@ -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 = "";
|
||||
|
Loading…
Reference in New Issue
Block a user