From a6f9a742c0dffeaa2f7fc26ad65e9c972a9d2288 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Mon, 19 May 2014 15:39:50 +0200 Subject: some code cleanup to deal with the roster mgmt changes from earlier --- .../siacs/conversations/ui/ShareWithActivity.java | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) (limited to 'src/eu/siacs/conversations/ui/ShareWithActivity.java') diff --git a/src/eu/siacs/conversations/ui/ShareWithActivity.java b/src/eu/siacs/conversations/ui/ShareWithActivity.java index ccb1e8e7..e4abfd2d 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 displayedContacts = new HashSet(); + Set displayedContacts = new HashSet(); conversations.removeAllViews(); List convList = xmppConnectionService.getConversations(); Collections.sort(convList, new Comparator() { @@ -95,15 +85,13 @@ public class ShareWithActivity extends XmppActivity { } }); conversations.addView(view); - if (conversation.getContact() != null) { - displayedContacts.add(conversation.getContact().getUuid()); - } + displayedContacts.add(conversation.getContact()); } contacts.removeAllViews(); - final List contactsList = new ArrayList(); + List contactsList = new ArrayList(); for(Account account : xmppConnectionService.getAccounts()) { - for(final Contact contact : account.getRoster().getContacts()) { - if (!displayedContacts.contains(contact.getUuid())) { + for(Contact contact : account.getRoster().getContacts()) { + if (!displayedContacts.contains(contact)&&(contact.getOption(Contact.Options.IN_ROSTER))) { contactsList.add(contact); } } -- cgit v1.2.3