diff options
Diffstat (limited to 'src/eu/siacs/conversations/ui/ShareWithActivity.java')
-rw-r--r-- | src/eu/siacs/conversations/ui/ShareWithActivity.java | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/src/eu/siacs/conversations/ui/ShareWithActivity.java b/src/eu/siacs/conversations/ui/ShareWithActivity.java index 1bc9fc46..6dbb20c9 100644 --- a/src/eu/siacs/conversations/ui/ShareWithActivity.java +++ b/src/eu/siacs/conversations/ui/ShareWithActivity.java @@ -17,7 +17,6 @@ import android.content.SharedPreferences; import android.graphics.Bitmap; import android.os.Bundle; import android.preference.PreferenceManager; -import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.ImageView; @@ -29,15 +28,6 @@ public class ShareWithActivity extends XmppActivity { private LinearLayout conversations; private LinearLayout contacts; - private OnClickListener click = new OnClickListener() { - - @Override - public void onClick(View v) { - // TODO Auto-generated method stub - - } - }; - @Override protected void onCreate(Bundle savedInstanceState) { @@ -71,7 +61,7 @@ public class ShareWithActivity extends XmppActivity { SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this); boolean useSubject = preferences.getBoolean("use_subject_in_muc", true); - Set<String> displayedContacts = new HashSet<String>(); + Set<Contact> displayedContacts = new HashSet<Contact>(); conversations.removeAllViews(); List<Conversation> convList = xmppConnectionService.getConversations(); Collections.sort(convList, new Comparator<Conversation>() { @@ -90,20 +80,18 @@ public class ShareWithActivity extends XmppActivity { @Override public void onClick(View v) { String sharedText = getIntent().getStringExtra(Intent.EXTRA_TEXT); - switchToConversation(conversation, sharedText); + switchToConversation(conversation, sharedText,true); finish(); } }); conversations.addView(view); - if (conversation.getContact() != null) { - displayedContacts.add(conversation.getContact().getUuid()); - } + displayedContacts.add(conversation.getContact()); } contacts.removeAllViews(); - final List<Contact> contactsList = new ArrayList<Contact>(); + List<Contact> contactsList = new ArrayList<Contact>(); for(Account account : xmppConnectionService.getAccounts()) { - for(final Contact contact : xmppConnectionService.getRoster(account)) { - if (!displayedContacts.contains(contact.getUuid())) { + for(Contact contact : account.getRoster().getContacts()) { + if (!displayedContacts.contains(contact)&&(contact.showInRoster())) { contactsList.add(contact); } } @@ -126,7 +114,7 @@ public class ShareWithActivity extends XmppActivity { public void onClick(View v) { String sharedText = getIntent().getStringExtra(Intent.EXTRA_TEXT); Conversation conversation = xmppConnectionService.findOrCreateConversation(con.getAccount(), con.getJid(), false); - switchToConversation(conversation, sharedText); + switchToConversation(conversation, sharedText,true); finish(); } }); |