diff options
author | iNPUTmice <daniel@gultsch.de> | 2014-09-27 11:37:02 +0200 |
---|---|---|
committer | iNPUTmice <daniel@gultsch.de> | 2014-09-27 11:37:02 +0200 |
commit | 8fb0fb0c0d7a760d1bea33701a794f3ab2ba6664 (patch) | |
tree | a5da94fdecb53b28e47381c4b34a1ffb7988c39a /src/eu/siacs/conversations/services/XmppConnectionService.java | |
parent | 6e7734340797c0e929a3669056d0c1361cac7384 (diff) |
anwser to xmpp: style uris. fixed open conversations from android address book
Diffstat (limited to 'src/eu/siacs/conversations/services/XmppConnectionService.java')
-rw-r--r-- | src/eu/siacs/conversations/services/XmppConnectionService.java | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/eu/siacs/conversations/services/XmppConnectionService.java b/src/eu/siacs/conversations/services/XmppConnectionService.java index db3ee2b9..524a3bd7 100644 --- a/src/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/eu/siacs/conversations/services/XmppConnectionService.java @@ -824,7 +824,7 @@ public class XmppConnectionService extends Service { } }); } - + public int loadMoreMessages(Conversation conversation, long timestamp) { List<Message> messages = databaseBackend.getMessages(conversation, 50, timestamp); @@ -851,8 +851,9 @@ public class XmppConnectionService extends Service { public Conversation find(List<Conversation> haystack, Account account, String jid) { for (Conversation conversation : haystack) { - if ((conversation.getAccount().equals(account)) - && (conversation.getContactJid().split("/",2)[0].equals(jid))) { + if ((account == null || conversation.getAccount().equals(account)) + && (conversation.getContactJid().split("/", 2)[0] + .equals(jid))) { return conversation; } } @@ -1742,4 +1743,18 @@ public class XmppConnectionService extends Service { public interface OnRosterUpdate { public void onRosterUpdate(); } + + public List<Contact> findContacts(String jid) { + ArrayList<Contact> contacts = new ArrayList<Contact>(); + for (Account account : getAccounts()) { + if (!account.isOptionSet(Account.OPTION_DISABLED)) { + Contact contact = account.getRoster() + .getContactAsShownInRoster(jid); + if (contact != null) { + contacts.add(contact); + } + } + } + return contacts; + } } |