2017-11-14 03:01:05 +01:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2014-2017 Open Whisper Systems
|
2014-08-15 08:11:06 +02:00
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2012-07-19 00:35:13 +02:00
|
|
|
package org.thoughtcrime.securesms;
|
|
|
|
|
2017-11-13 18:31:01 +01:00
|
|
|
import android.annotation.SuppressLint;
|
2016-08-14 12:23:51 +02:00
|
|
|
import android.content.ActivityNotFoundException;
|
2017-10-09 03:09:46 +02:00
|
|
|
import android.content.Context;
|
2012-07-19 00:35:13 +02:00
|
|
|
import android.content.Intent;
|
2019-07-22 04:13:53 +02:00
|
|
|
import android.graphics.Outline;
|
2019-11-26 22:53:57 +01:00
|
|
|
import android.graphics.drawable.Drawable;
|
2015-11-24 01:02:05 +01:00
|
|
|
import android.net.Uri;
|
2013-05-06 22:59:40 +02:00
|
|
|
import android.os.AsyncTask;
|
2012-07-19 00:35:13 +02:00
|
|
|
import android.os.Bundle;
|
2018-10-26 00:14:34 +02:00
|
|
|
import android.support.annotation.NonNull;
|
2017-11-13 04:14:57 +01:00
|
|
|
import android.support.v7.widget.Toolbar;
|
2018-06-30 11:49:44 +02:00
|
|
|
import android.support.v7.widget.TooltipCompat;
|
2014-06-29 05:40:57 +02:00
|
|
|
import android.view.Menu;
|
2019-10-15 07:19:00 +02:00
|
|
|
import android.view.MenuInflater;
|
2014-06-29 05:40:57 +02:00
|
|
|
import android.view.MenuItem;
|
2019-07-22 04:13:53 +02:00
|
|
|
import android.view.View;
|
2018-04-07 03:15:24 +02:00
|
|
|
import android.view.ViewGroup;
|
2019-07-22 04:13:53 +02:00
|
|
|
import android.view.ViewOutlineProvider;
|
2017-11-13 21:44:51 +01:00
|
|
|
import android.widget.ImageView;
|
2016-08-14 12:23:51 +02:00
|
|
|
import android.widget.Toast;
|
2013-12-02 21:31:59 +01:00
|
|
|
|
2019-11-26 22:53:57 +01:00
|
|
|
import com.bumptech.glide.load.engine.DiskCacheStrategy;
|
|
|
|
|
2019-11-27 23:25:00 +01:00
|
|
|
import org.greenrobot.eventbus.EventBus;
|
|
|
|
import org.greenrobot.eventbus.Subscribe;
|
|
|
|
import org.greenrobot.eventbus.ThreadMode;
|
2015-03-31 21:34:49 +02:00
|
|
|
import org.thoughtcrime.securesms.components.RatingManager;
|
2017-11-13 21:44:51 +01:00
|
|
|
import org.thoughtcrime.securesms.components.SearchToolbar;
|
2019-02-01 04:28:40 +01:00
|
|
|
import org.thoughtcrime.securesms.conversation.ConversationActivity;
|
2018-09-25 08:41:29 +02:00
|
|
|
import org.thoughtcrime.securesms.database.Address;
|
2013-05-06 22:59:40 +02:00
|
|
|
import org.thoughtcrime.securesms.database.DatabaseFactory;
|
2017-10-09 03:09:46 +02:00
|
|
|
import org.thoughtcrime.securesms.database.MessagingDatabase.MarkedMessageInfo;
|
2018-03-01 18:51:37 +01:00
|
|
|
import org.thoughtcrime.securesms.lock.RegistrationLockDialog;
|
2019-11-27 23:25:00 +01:00
|
|
|
import org.thoughtcrime.securesms.loki.RecipientAvatarModifiedEvent;
|
2020-01-31 02:50:25 +01:00
|
|
|
import org.thoughtcrime.securesms.loki.redesign.activities.JoinPublicChatActivity;
|
2019-11-26 22:53:57 +01:00
|
|
|
import org.thoughtcrime.securesms.mms.GlideApp;
|
2017-10-09 03:09:46 +02:00
|
|
|
import org.thoughtcrime.securesms.notifications.MarkReadReceiver;
|
2013-05-06 22:59:40 +02:00
|
|
|
import org.thoughtcrime.securesms.notifications.MessageNotifier;
|
2017-08-01 17:56:00 +02:00
|
|
|
import org.thoughtcrime.securesms.recipients.Recipient;
|
2018-04-07 03:15:24 +02:00
|
|
|
import org.thoughtcrime.securesms.search.SearchFragment;
|
2012-07-19 00:35:13 +02:00
|
|
|
import org.thoughtcrime.securesms.service.KeyCachingService;
|
2013-06-30 03:03:55 +02:00
|
|
|
import org.thoughtcrime.securesms.util.DynamicLanguage;
|
2017-11-13 04:14:57 +01:00
|
|
|
import org.thoughtcrime.securesms.util.DynamicNoActionBarTheme;
|
2013-06-21 20:56:59 +02:00
|
|
|
import org.thoughtcrime.securesms.util.DynamicTheme;
|
2013-12-19 05:15:21 +01:00
|
|
|
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
2019-01-15 09:41:05 +01:00
|
|
|
import org.thoughtcrime.securesms.util.concurrent.SimpleTask;
|
2012-07-19 00:35:13 +02:00
|
|
|
|
2017-10-09 03:09:46 +02:00
|
|
|
import java.util.List;
|
|
|
|
|
2019-07-24 04:30:23 +02:00
|
|
|
import network.loki.messenger.R;
|
|
|
|
|
2014-06-29 05:40:57 +02:00
|
|
|
public class ConversationListActivity extends PassphraseRequiredActionBarActivity
|
2014-08-15 08:11:06 +02:00
|
|
|
implements ConversationListFragment.ConversationSelectedListener
|
2014-12-15 21:25:55 +01:00
|
|
|
{
|
2017-11-20 23:48:39 +01:00
|
|
|
@SuppressWarnings("unused")
|
2015-04-04 10:38:44 +02:00
|
|
|
private static final String TAG = ConversationListActivity.class.getSimpleName();
|
|
|
|
|
2017-11-13 04:14:57 +01:00
|
|
|
private final DynamicTheme dynamicTheme = new DynamicNoActionBarTheme();
|
2013-06-30 03:03:55 +02:00
|
|
|
private final DynamicLanguage dynamicLanguage = new DynamicLanguage();
|
2012-07-19 00:35:13 +02:00
|
|
|
|
2018-04-07 03:15:24 +02:00
|
|
|
private ConversationListFragment conversationListFragment;
|
|
|
|
private SearchFragment searchFragment;
|
2017-11-13 21:44:51 +01:00
|
|
|
private SearchToolbar searchToolbar;
|
|
|
|
private ImageView searchAction;
|
2018-04-07 03:15:24 +02:00
|
|
|
private ViewGroup fragmentContainer;
|
2012-07-19 00:35:13 +02:00
|
|
|
|
|
|
|
@Override
|
2014-12-15 21:25:55 +01:00
|
|
|
protected void onPreCreate() {
|
2013-06-21 20:56:59 +02:00
|
|
|
dynamicTheme.onCreate(this);
|
2013-06-30 03:03:55 +02:00
|
|
|
dynamicLanguage.onCreate(this);
|
2019-08-05 04:08:23 +02:00
|
|
|
if (TextSecurePreferences.getLocalNumber(this) != null) {
|
2019-08-28 06:19:08 +02:00
|
|
|
ApplicationContext application = ApplicationContext.getInstance(this);
|
2019-10-15 07:06:38 +02:00
|
|
|
application.createDefaultPublicChatsIfNeeded();
|
2019-08-28 06:19:08 +02:00
|
|
|
application.createRSSFeedsIfNeeded();
|
2019-10-15 07:06:38 +02:00
|
|
|
application.getLokiPublicChatManager().startPollersIfNeeded();
|
2019-08-28 06:19:08 +02:00
|
|
|
application.startRSSFeedPollersIfNeeded();
|
2019-08-05 04:08:23 +02:00
|
|
|
}
|
2014-12-15 21:25:55 +01:00
|
|
|
}
|
2015-01-21 08:26:58 +01:00
|
|
|
|
2014-12-15 21:25:55 +01:00
|
|
|
@Override
|
2018-02-02 04:22:48 +01:00
|
|
|
protected void onCreate(Bundle icicle, boolean ready) {
|
2017-11-13 04:14:57 +01:00
|
|
|
setContentView(R.layout.conversation_list_activity);
|
|
|
|
|
|
|
|
Toolbar toolbar = findViewById(R.id.toolbar);
|
|
|
|
setSupportActionBar(toolbar);
|
|
|
|
|
2018-04-07 03:15:24 +02:00
|
|
|
searchToolbar = findViewById(R.id.search_toolbar);
|
|
|
|
searchAction = findViewById(R.id.search_action);
|
|
|
|
fragmentContainer = findViewById(R.id.fragment_container);
|
|
|
|
conversationListFragment = initFragment(R.id.fragment_container, new ConversationListFragment(), dynamicLanguage.getCurrentLocale());
|
2012-07-19 00:35:13 +02:00
|
|
|
|
2017-11-13 21:44:51 +01:00
|
|
|
initializeSearchListener();
|
2013-10-13 13:38:26 +02:00
|
|
|
|
2015-03-31 21:34:49 +02:00
|
|
|
RatingManager.showRatingDialogIfNecessary(this);
|
2018-03-01 18:51:37 +01:00
|
|
|
RegistrationLockDialog.showReminderIfNecessary(this);
|
2018-06-30 11:49:44 +02:00
|
|
|
|
|
|
|
TooltipCompat.setTooltipText(searchAction, getText(R.string.SearchToolbar_search_for_conversations_contacts_and_messages));
|
2012-07-19 00:35:13 +02:00
|
|
|
}
|
|
|
|
|
2013-06-21 20:56:59 +02:00
|
|
|
@Override
|
|
|
|
public void onResume() {
|
|
|
|
super.onResume();
|
|
|
|
dynamicTheme.onResume(this);
|
2013-06-30 03:03:55 +02:00
|
|
|
dynamicLanguage.onResume(this);
|
2018-09-25 08:41:29 +02:00
|
|
|
|
2019-01-15 09:41:05 +01:00
|
|
|
SimpleTask.run(getLifecycle(), () -> {
|
2018-10-26 00:14:34 +02:00
|
|
|
return Recipient.from(this, Address.fromSerialized(TextSecurePreferences.getLocalNumber(this)), false);
|
|
|
|
}, this::initializeProfileIcon);
|
2013-06-21 20:56:59 +02:00
|
|
|
}
|
|
|
|
|
2012-07-19 00:35:13 +02:00
|
|
|
@Override
|
|
|
|
public void onDestroy() {
|
|
|
|
super.onDestroy();
|
|
|
|
}
|
|
|
|
|
2019-11-27 23:25:00 +01:00
|
|
|
@Override
|
|
|
|
public void onStart() {
|
|
|
|
super.onStart();
|
|
|
|
EventBus.getDefault().register(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onStop() {
|
|
|
|
EventBus.getDefault().unregister(this);
|
|
|
|
super.onStop();
|
|
|
|
}
|
|
|
|
|
2012-07-19 00:35:13 +02:00
|
|
|
@Override
|
|
|
|
public boolean onPrepareOptionsMenu(Menu menu) {
|
2014-06-29 05:40:57 +02:00
|
|
|
MenuInflater inflater = this.getMenuInflater();
|
2012-07-19 00:35:13 +02:00
|
|
|
menu.clear();
|
|
|
|
|
2013-02-17 20:42:30 +01:00
|
|
|
inflater.inflate(R.menu.text_secure_normal, menu);
|
2012-07-19 00:35:13 +02:00
|
|
|
|
2019-10-15 07:19:00 +02:00
|
|
|
// menu.findItem(R.id.menu_clear_passphrase).setVisible(!TextSecurePreferences.isPasswordDisabled(this));
|
2013-12-19 05:15:21 +01:00
|
|
|
|
2012-07-19 00:35:13 +02:00
|
|
|
super.onPrepareOptionsMenu(menu);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2017-11-13 21:44:51 +01:00
|
|
|
private void initializeSearchListener() {
|
2017-12-19 19:54:06 +01:00
|
|
|
searchAction.setOnClickListener(v -> {
|
2019-10-31 06:09:29 +01:00
|
|
|
/* Loki - We don't need contact permissions
|
2017-12-19 19:54:06 +01:00
|
|
|
Permissions.with(this)
|
|
|
|
.request(Manifest.permission.READ_CONTACTS, Manifest.permission.WRITE_CONTACTS)
|
|
|
|
.ifNecessary()
|
|
|
|
.onAllGranted(() -> searchToolbar.display(searchAction.getX() + (searchAction.getWidth() / 2),
|
|
|
|
searchAction.getY() + (searchAction.getHeight() / 2)))
|
|
|
|
.withPermanentDenialDialog(getString(R.string.ConversationListActivity_signal_needs_contacts_permission_in_order_to_search_your_contacts_but_it_has_been_permanently_denied))
|
|
|
|
.execute();
|
2019-10-31 06:09:29 +01:00
|
|
|
*/
|
2017-12-19 19:54:06 +01:00
|
|
|
});
|
2014-10-26 23:24:55 +01:00
|
|
|
|
2017-11-13 21:44:51 +01:00
|
|
|
searchToolbar.setListener(new SearchToolbar.SearchListener() {
|
2014-10-26 23:24:55 +01:00
|
|
|
@Override
|
2017-11-13 21:44:51 +01:00
|
|
|
public void onSearchTextChange(String text) {
|
2018-04-07 03:15:24 +02:00
|
|
|
String trimmed = text.trim();
|
|
|
|
|
|
|
|
if (trimmed.length() > 0) {
|
|
|
|
if (searchFragment == null) {
|
|
|
|
searchFragment = SearchFragment.newInstance(dynamicLanguage.getCurrentLocale());
|
|
|
|
getSupportFragmentManager().beginTransaction()
|
|
|
|
.add(R.id.fragment_container, searchFragment, null)
|
|
|
|
.commit();
|
|
|
|
}
|
|
|
|
searchFragment.updateSearchQuery(trimmed);
|
|
|
|
} else if (searchFragment != null) {
|
|
|
|
getSupportFragmentManager().beginTransaction()
|
|
|
|
.remove(searchFragment)
|
|
|
|
.commit();
|
|
|
|
searchFragment = null;
|
2017-11-13 21:44:51 +01:00
|
|
|
}
|
2014-10-26 23:24:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2018-04-07 03:15:24 +02:00
|
|
|
public void onSearchClosed() {
|
|
|
|
if (searchFragment != null) {
|
|
|
|
getSupportFragmentManager().beginTransaction()
|
|
|
|
.remove(searchFragment)
|
|
|
|
.commit();
|
|
|
|
searchFragment = null;
|
2014-10-26 23:24:55 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2014-06-29 05:40:57 +02:00
|
|
|
}
|
|
|
|
|
2018-10-26 00:14:34 +02:00
|
|
|
private void initializeProfileIcon(@NonNull Recipient recipient) {
|
2019-07-22 04:13:53 +02:00
|
|
|
ImageView profilePictureImageView = findViewById(R.id.toolbar_icon);
|
|
|
|
profilePictureImageView.setOutlineProvider(new ViewOutlineProvider() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void getOutline(View view, Outline outline) {
|
|
|
|
outline.setOval(0, 0, view.getWidth(), view.getHeight());
|
|
|
|
}
|
|
|
|
});
|
2019-11-26 22:53:57 +01:00
|
|
|
profilePictureImageView.setClipToOutline(true);
|
2019-10-24 04:35:14 +02:00
|
|
|
|
|
|
|
// Display the correct identicon if we're a secondary device
|
|
|
|
String primaryAddress = TextSecurePreferences.getMasterHexEncodedPublicKey(this);
|
2019-11-28 01:19:39 +01:00
|
|
|
String profileAddress = (recipient.isLocalNumber() && primaryAddress != null) ? primaryAddress : recipient.getAddress().serialize();
|
2019-11-26 22:53:57 +01:00
|
|
|
Recipient primaryRecipient = Recipient.from(this, Address.fromSerialized(profileAddress), false);
|
2019-10-24 04:35:14 +02:00
|
|
|
|
2019-11-26 22:53:57 +01:00
|
|
|
Drawable fallback = primaryRecipient.getFallbackContactPhotoDrawable(this, false);
|
2018-09-25 08:41:29 +02:00
|
|
|
|
|
|
|
GlideApp.with(this)
|
2019-11-27 23:25:00 +01:00
|
|
|
.load(primaryRecipient.getContactPhoto())
|
2019-11-26 22:53:57 +01:00
|
|
|
.fallback(fallback)
|
2018-09-25 08:41:29 +02:00
|
|
|
.error(fallback)
|
|
|
|
.diskCacheStrategy(DiskCacheStrategy.ALL)
|
2019-11-26 22:53:57 +01:00
|
|
|
.circleCrop()
|
|
|
|
.into(profilePictureImageView);
|
|
|
|
|
2018-09-25 08:41:29 +02:00
|
|
|
|
2019-07-22 04:13:53 +02:00
|
|
|
profilePictureImageView.setOnClickListener(v -> handleDisplaySettings());
|
2018-09-25 08:41:29 +02:00
|
|
|
}
|
|
|
|
|
2012-07-19 00:35:13 +02:00
|
|
|
@Override
|
|
|
|
public boolean onOptionsItemSelected(MenuItem item) {
|
|
|
|
super.onOptionsItemSelected(item);
|
|
|
|
|
|
|
|
switch (item.getItemId()) {
|
2019-10-15 07:19:00 +02:00
|
|
|
// case R.id.menu_new_group: createGroup(); return true;
|
|
|
|
// case R.id.menu_settings: handleDisplaySettings(); return true;
|
|
|
|
// case R.id.menu_clear_passphrase: handleClearPassphrase(); return true;
|
|
|
|
// case R.id.menu_mark_all_read: handleMarkAllRead(); return true;
|
|
|
|
// case R.id.menu_invite: handleInvite(); return true;
|
|
|
|
// case R.id.menu_help: handleHelp(); return true;
|
|
|
|
case R.id.menu_conversation_list_add_public_chat_option: addNewPublicChat(); return true;
|
2012-07-19 00:35:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2017-08-01 17:56:00 +02:00
|
|
|
public void onCreateConversation(long threadId, Recipient recipient, int distributionType, long lastSeen) {
|
2018-04-07 03:15:24 +02:00
|
|
|
openConversation(threadId, recipient, distributionType, lastSeen, -1);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void openConversation(long threadId, Recipient recipient, int distributionType, long lastSeen, int startingPosition) {
|
|
|
|
searchToolbar.clearFocus();
|
|
|
|
|
2012-07-19 23:22:03 +02:00
|
|
|
Intent intent = new Intent(this, ConversationActivity.class);
|
2017-08-01 17:56:00 +02:00
|
|
|
intent.putExtra(ConversationActivity.ADDRESS_EXTRA, recipient.getAddress());
|
2013-02-03 05:37:40 +01:00
|
|
|
intent.putExtra(ConversationActivity.THREAD_ID_EXTRA, threadId);
|
2013-04-26 03:59:49 +02:00
|
|
|
intent.putExtra(ConversationActivity.DISTRIBUTION_TYPE_EXTRA, distributionType);
|
2017-01-19 20:37:19 +01:00
|
|
|
intent.putExtra(ConversationActivity.TIMING_EXTRA, System.currentTimeMillis());
|
2017-02-14 07:35:47 +01:00
|
|
|
intent.putExtra(ConversationActivity.LAST_SEEN_EXTRA, lastSeen);
|
2018-04-07 03:15:24 +02:00
|
|
|
intent.putExtra(ConversationActivity.STARTING_POSITION_EXTRA, startingPosition);
|
2013-02-03 05:37:40 +01:00
|
|
|
|
2012-07-19 00:35:13 +02:00
|
|
|
startActivity(intent);
|
2015-06-22 17:46:43 +02:00
|
|
|
overridePendingTransition(R.anim.slide_from_right, R.anim.fade_scale_out);
|
2012-07-19 00:35:13 +02:00
|
|
|
}
|
|
|
|
|
2015-11-24 00:07:41 +01:00
|
|
|
@Override
|
|
|
|
public void onSwitchToArchive() {
|
|
|
|
Intent intent = new Intent(this, ConversationListArchiveActivity.class);
|
|
|
|
startActivity(intent);
|
|
|
|
}
|
|
|
|
|
2017-11-13 21:44:51 +01:00
|
|
|
@Override
|
|
|
|
public void onBackPressed() {
|
|
|
|
if (searchToolbar.isVisible()) searchToolbar.collapse();
|
|
|
|
else super.onBackPressed();
|
|
|
|
}
|
|
|
|
|
2015-11-24 00:07:41 +01:00
|
|
|
private void createGroup() {
|
|
|
|
Intent intent = new Intent(this, GroupCreateActivity.class);
|
|
|
|
startActivity(intent);
|
|
|
|
}
|
|
|
|
|
2012-07-19 00:35:13 +02:00
|
|
|
private void handleDisplaySettings() {
|
|
|
|
Intent preferencesIntent = new Intent(this, ApplicationPreferencesActivity.class);
|
|
|
|
startActivity(preferencesIntent);
|
|
|
|
}
|
|
|
|
|
|
|
|
private void handleClearPassphrase() {
|
2013-02-08 20:57:54 +01:00
|
|
|
Intent intent = new Intent(this, KeyCachingService.class);
|
|
|
|
intent.setAction(KeyCachingService.CLEAR_KEY_ACTION);
|
|
|
|
startService(intent);
|
2012-07-19 00:35:13 +02:00
|
|
|
}
|
|
|
|
|
2017-11-13 18:31:01 +01:00
|
|
|
@SuppressLint("StaticFieldLeak")
|
2013-05-06 22:59:40 +02:00
|
|
|
private void handleMarkAllRead() {
|
|
|
|
new AsyncTask<Void, Void, Void>() {
|
|
|
|
@Override
|
|
|
|
protected Void doInBackground(Void... params) {
|
2017-10-09 03:09:46 +02:00
|
|
|
Context context = ConversationListActivity.this;
|
|
|
|
List<MarkedMessageInfo> messageIds = DatabaseFactory.getThreadDatabase(context).setAllThreadsRead();
|
|
|
|
|
2018-01-25 04:17:44 +01:00
|
|
|
MessageNotifier.updateNotification(context);
|
2017-10-09 03:09:46 +02:00
|
|
|
MarkReadReceiver.process(context, messageIds);
|
2017-10-09 03:46:09 +02:00
|
|
|
|
2013-05-06 22:59:40 +02:00
|
|
|
return null;
|
|
|
|
}
|
2017-10-23 22:03:32 +02:00
|
|
|
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
2013-05-06 22:59:40 +02:00
|
|
|
}
|
|
|
|
|
2015-10-19 20:23:12 +02:00
|
|
|
private void handleInvite() {
|
|
|
|
startActivity(new Intent(this, InviteActivity.class));
|
|
|
|
}
|
|
|
|
|
2015-11-24 01:02:05 +01:00
|
|
|
private void handleHelp() {
|
2016-08-14 12:23:51 +02:00
|
|
|
try {
|
2019-03-13 22:19:33 +01:00
|
|
|
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://support.signal.org")));
|
2016-08-14 12:23:51 +02:00
|
|
|
} catch (ActivityNotFoundException e) {
|
|
|
|
Toast.makeText(this, R.string.ConversationListActivity_there_is_no_browser_installed_on_your_device, Toast.LENGTH_LONG).show();
|
|
|
|
}
|
2015-11-24 01:02:05 +01:00
|
|
|
}
|
2019-10-15 07:19:00 +02:00
|
|
|
|
|
|
|
private void addNewPublicChat() {
|
2020-01-31 02:50:25 +01:00
|
|
|
startActivity(new Intent(this, JoinPublicChatActivity.class));
|
2019-10-15 07:19:00 +02:00
|
|
|
}
|
2019-11-27 23:25:00 +01:00
|
|
|
|
|
|
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
|
|
|
public void onAvatarModified(RecipientAvatarModifiedEvent event) {
|
|
|
|
Recipient recipient = event.getRecipient();
|
2019-11-28 01:19:39 +01:00
|
|
|
if (recipient.isLocalNumber() || recipient.isOurMasterDevice()) {
|
2019-11-27 23:25:00 +01:00
|
|
|
initializeProfileIcon(recipient);
|
|
|
|
}
|
|
|
|
}
|
2013-12-02 21:31:59 +01:00
|
|
|
}
|