That fuck shit the fascists are using
1/*
2 * Copyright (C) 2011 Whisper Systems
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17package org.tm.archive;
18
19import android.content.Intent;
20import android.os.Bundle;
21
22import com.annimon.stream.Stream;
23
24import org.signal.core.util.logging.Log;
25import org.tm.archive.contacts.SelectedContact;
26import org.tm.archive.recipients.RecipientId;
27
28import java.util.ArrayList;
29import java.util.List;
30
31/**
32 * Activity container for selecting a list of contacts.
33 *
34 * @author Moxie Marlinspike
35 *
36 */
37public class PushContactSelectionActivity extends ContactSelectionActivity {
38
39 public static final String KEY_SELECTED_RECIPIENTS = "recipients";
40
41 @SuppressWarnings("unused")
42 private final static String TAG = Log.tag(PushContactSelectionActivity.class);
43
44 @Override
45 protected void onCreate(Bundle icicle, boolean ready) {
46 super.onCreate(icicle, ready);
47
48 initializeToolbar();
49 }
50
51 protected void initializeToolbar() {
52 getToolbar().setNavigationIcon(R.drawable.ic_check_24);
53 getToolbar().setNavigationOnClickListener(v -> {
54 onFinishedSelection();
55 });
56 }
57
58 protected final void onFinishedSelection() {
59 Intent resultIntent = getIntent();
60 List<SelectedContact> selectedContacts = contactsFragment.getSelectedContacts();
61 List<RecipientId> recipients = Stream.of(selectedContacts).map(sc -> sc.getOrCreateRecipientId(this)).toList();
62
63 resultIntent.putParcelableArrayListExtra(KEY_SELECTED_RECIPIENTS, new ArrayList<>(recipients));
64
65 setResult(RESULT_OK, resultIntent);
66 finish();
67 }
68
69 @Override
70 public void onSelectionChanged() {
71 }
72}