aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/services
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2014-03-05 15:41:14 +0100
committerDaniel Gultsch <daniel@gultsch.de>2014-03-05 15:41:14 +0100
commit78312d71dd1f281f494a2a1c04e4a80f34898d2c (patch)
tree595d3f78836691fc8eb204a3102b8781c4e3bd14 /src/eu/siacs/conversations/services
parent79ec8b2e8128a1dc1d7d0962ce99e91fdaff8b98 (diff)
reworked contact details
Diffstat (limited to 'src/eu/siacs/conversations/services')
-rw-r--r--src/eu/siacs/conversations/services/XmppConnectionService.java17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/eu/siacs/conversations/services/XmppConnectionService.java b/src/eu/siacs/conversations/services/XmppConnectionService.java
index 48f0e470..e973afa9 100644
--- a/src/eu/siacs/conversations/services/XmppConnectionService.java
+++ b/src/eu/siacs/conversations/services/XmppConnectionService.java
@@ -535,7 +535,7 @@ public class XmppConnectionService extends Service {
public void getRoster(Account account,
final OnRosterFetchedListener listener) {
- List<Contact> contacts = databaseBackend.getContacts(account);
+ List<Contact> contacts = databaseBackend.getContactsByAccount(account);
for (int i = 0; i < contacts.size(); ++i) {
contacts.get(i).setAccount(account);
}
@@ -575,7 +575,7 @@ public class XmppConnectionService extends Service {
mWhere.append(account.getUuid());
mWhere.append("\"");
List<Contact> contactsToDelete = databaseBackend
- .getContats(mWhere.toString());
+ .getContacts(mWhere.toString());
for (Contact contact : contactsToDelete) {
databaseBackend.deleteContact(contact);
replaceContactInConversation(contact.getJid(),
@@ -604,7 +604,7 @@ public class XmppConnectionService extends Service {
public void onPhoneContactsLoaded(
Hashtable<String, Bundle> phoneContacts) {
List<Contact> contacts = databaseBackend
- .getContacts(null);
+ .getContactsByAccount(null);
for (int i = 0; i < contacts.size(); ++i) {
Contact contact = contacts.get(i);
if (phoneContacts.containsKey(contact.getJid())) {
@@ -938,6 +938,7 @@ public class XmppConnectionService extends Service {
public void updateContact(Contact contact) {
databaseBackend.updateContact(contact);
+ replaceContactInConversation(contact.getJid(), contact);
}
public void updateMessage(Message message) {
@@ -1035,4 +1036,14 @@ public class XmppConnectionService extends Service {
public void updateConversation(Conversation conversation) {
this.databaseBackend.updateConversation(conversation);
}
+
+ public Contact findContact(String uuid) {
+ Contact contact = this.databaseBackend.getContact(uuid);
+ for(Account account : getAccounts()) {
+ if (contact.getAccountUuid().equals(account.getUuid())) {
+ contact.setAccount(account);
+ }
+ }
+ return contact;
+ }
} \ No newline at end of file