diff options
author | Daniel Gultsch <daniel.gultsch@rwth-aachen.de> | 2014-02-23 21:33:37 +0100 |
---|---|---|
committer | Daniel Gultsch <daniel.gultsch@rwth-aachen.de> | 2014-02-23 21:33:37 +0100 |
commit | bfee69b00b2762a910f7f3f1714d18fddc99a9ad (patch) | |
tree | 56b370ae05bff9174ceeb4c7423d90c2d5bb8406 /src/de/gultsch/chat/ui | |
parent | 4bffb4d94db6d32d8e98b8241402cb5e51a879e7 (diff) |
add contact to roster if a new conversation is created
Diffstat (limited to 'src/de/gultsch/chat/ui')
-rw-r--r-- | src/de/gultsch/chat/ui/NewConversationActivity.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/de/gultsch/chat/ui/NewConversationActivity.java b/src/de/gultsch/chat/ui/NewConversationActivity.java index a41e3e39..ac178fad 100644 --- a/src/de/gultsch/chat/ui/NewConversationActivity.java +++ b/src/de/gultsch/chat/ui/NewConversationActivity.java @@ -79,6 +79,7 @@ public class NewConversationActivity extends XmppActivity { if (Validator.isValidJid(searchString)) { String name = searchString.split("@")[0]; Contact newContact = new Contact(null, name, searchString, null); + newContact.flagAsNotInRoster(); aggregatedContacts.add(newContact); contactsHeader.setText("Create new contact"); } else { @@ -228,7 +229,9 @@ public class NewConversationActivity extends XmppActivity { } public void startConversation(Contact contact, Account account, boolean muc) { - Log.d("xmppService","starting conversation for account:"+account.getJid()+" and contact:"+contact.getJid()); + if (!contact.isInRoster()) { + xmppConnectionService.createContact(contact); + } Conversation conversation = xmppConnectionService .findOrCreateConversation(account, contact.getJid(), muc); |