From 819f414446e0024140e7d5be746ec48b62be533f Mon Sep 17 00:00:00 2001 From: nielsandriesse Date: Wed, 13 May 2020 09:07:51 +1000 Subject: [PATCH] Clean & debug --- .../securesms/RegistrationActivity.java | 2 +- .../conversation/ConversationActivity.java | 2 +- .../securesms/crypto/PreKeyUtil.java | 4 +-- .../securesms/database/GroupDatabase.java | 6 ++-- .../securesms/database/SmsDatabase.java | 3 +- .../SignalCommunicationModule.java | 2 +- .../securesms/jobs/JobManagerFactories.java | 2 +- .../jobs/MultiDeviceContactUpdateJob.java | 2 +- .../jobs/MultiDeviceGroupUpdateJob.java | 2 +- .../securesms/jobs/PushMediaSendJob.java | 7 ++--- .../securesms/jobs/PushTextSendJob.java | 7 ++--- .../securesms/jobs/RefreshPreKeysJob.java | 2 +- .../securesms/jobs/RotateSignedPreKeyJob.java | 1 + .../loki/database/LokiPreKeyRecordDatabase.kt | 2 +- .../MultiDeviceOpenGroupUpdateJob.kt | 14 ++++------ .../widgets/ProfilePreference.java | 28 +++++++++---------- .../registration/WelcomeActivity.java | 2 -- .../securesms/service/WebRtcCallService.java | 1 - .../securesms/sms/MessageSender.java | 2 +- .../securesms/util/IdentityUtil.java | 7 +++-- 20 files changed, 46 insertions(+), 52 deletions(-) rename src/org/thoughtcrime/securesms/loki/{ => protocol}/MultiDeviceOpenGroupUpdateJob.kt (89%) diff --git a/src/org/thoughtcrime/securesms/RegistrationActivity.java b/src/org/thoughtcrime/securesms/RegistrationActivity.java index 6f5ba224be..26395e4fcd 100644 --- a/src/org/thoughtcrime/securesms/RegistrationActivity.java +++ b/src/org/thoughtcrime/securesms/RegistrationActivity.java @@ -618,7 +618,7 @@ public class RegistrationActivity extends BaseActionBarActivity implements Verif unidentifiedAccessKey, universalUnidentifiedAccess); IdentityKeyPair identityKey = IdentityKeyUtil.getIdentityKeyPair(RegistrationActivity.this); - List records = PreKeyUtil.generatePreKeys(RegistrationActivity.this); + List records = PreKeyUtil.generatePreKeyRecords(RegistrationActivity.this); SignedPreKeyRecord signedPreKey = PreKeyUtil.generateSignedPreKey(RegistrationActivity.this, identityKey, true); accountManager.setPreKeys(identityKey.getPublicKey(), signedPreKey, records); diff --git a/src/org/thoughtcrime/securesms/conversation/ConversationActivity.java b/src/org/thoughtcrime/securesms/conversation/ConversationActivity.java index 058aa2e074..60793f70d2 100644 --- a/src/org/thoughtcrime/securesms/conversation/ConversationActivity.java +++ b/src/org/thoughtcrime/securesms/conversation/ConversationActivity.java @@ -3270,7 +3270,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity for (String device : devices) { MessageSender.sendRestoreSessionMessage(this, device); } long messageID = smsDatabase.insertMessageOutbox(threadId, new OutgoingTextMessage(recipient,"", 0, 0), false, System.currentTimeMillis(), null); if (messageID > -1) { - smsDatabase.markAsLokiSessionRestoreSent(messageID); + smsDatabase.markAsSentLokiSessionRestorationRequest(messageID); } lokiThreadDatabase.removeAllSessionRestoreDevices(threadId); updateSessionRestoreBanner(); diff --git a/src/org/thoughtcrime/securesms/crypto/PreKeyUtil.java b/src/org/thoughtcrime/securesms/crypto/PreKeyUtil.java index 7f7d939395..856a0aa52d 100644 --- a/src/org/thoughtcrime/securesms/crypto/PreKeyUtil.java +++ b/src/org/thoughtcrime/securesms/crypto/PreKeyUtil.java @@ -43,7 +43,7 @@ public class PreKeyUtil { private static final int BATCH_SIZE = 100; - public synchronized static List generatePreKeys(Context context) { + public synchronized static List generatePreKeyRecords(Context context) { PreKeyStore preKeyStore = new TextSecurePreKeyStore(context); List records = new LinkedList<>(); int preKeyIdOffset = TextSecurePreferences.getNextPreKeyId(context); @@ -101,7 +101,7 @@ public class PreKeyUtil { } } - public synchronized static List generatePreKeys(Context context, int amount) { + public synchronized static List generatePreKeyRecords(Context context, int amount) { List records = new LinkedList<>(); int preKeyIDOffset = TextSecurePreferences.getNextPreKeyId(context); for (int i = 0; i < amount; i++) { diff --git a/src/org/thoughtcrime/securesms/database/GroupDatabase.java b/src/org/thoughtcrime/securesms/database/GroupDatabase.java index 67b6418ad7..2da43b0c5f 100644 --- a/src/org/thoughtcrime/securesms/database/GroupDatabase.java +++ b/src/org/thoughtcrime/securesms/database/GroupDatabase.java @@ -167,7 +167,7 @@ public class GroupDatabase extends Database { GroupRecord record; while ((record = reader.getNext()) != null) { - if (record.isSignalGroup() && record.members.contains(address)) { + if (record.isClosedGroup() && record.members.contains(address)) { return true; } } @@ -490,11 +490,11 @@ public class GroupDatabase extends Database { return mms; } - public boolean isPublicChat() { return Address.fromSerialized(id).isOpenGroup(); } + public boolean isOpenGroup() { return Address.fromSerialized(id).isOpenGroup(); } public boolean isRSSFeed() { return Address.fromSerialized(id).isRSSFeed(); } - public boolean isSignalGroup() { return Address.fromSerialized(id).isClosedGroup(); } + public boolean isClosedGroup() { return Address.fromSerialized(id).isClosedGroup(); } public String getUrl() { return url; } diff --git a/src/org/thoughtcrime/securesms/database/SmsDatabase.java b/src/org/thoughtcrime/securesms/database/SmsDatabase.java index 2dcc72d5ea..38b5c1f95c 100644 --- a/src/org/thoughtcrime/securesms/database/SmsDatabase.java +++ b/src/org/thoughtcrime/securesms/database/SmsDatabase.java @@ -47,7 +47,6 @@ import org.whispersystems.libsignal.util.guava.Optional; import java.io.IOException; import java.security.SecureRandom; -import java.util.ArrayList; import java.util.HashSet; import java.util.LinkedList; import java.util.List; @@ -252,7 +251,7 @@ public class SmsDatabase extends MessagingDatabase { updateTypeBitmask(id, Types.ENCRYPTION_MASK, Types.ENCRYPTION_REMOTE_NO_SESSION_BIT); } - public void markAsLokiSessionRestoreSent(long id) { + public void markAsSentLokiSessionRestorationRequest(long id) { updateTypeBitmask(id, Types.ENCRYPTION_MASK, Types.ENCRYPTION_LOKI_SESSION_RESTORE_SENT_BIT); } diff --git a/src/org/thoughtcrime/securesms/dependencies/SignalCommunicationModule.java b/src/org/thoughtcrime/securesms/dependencies/SignalCommunicationModule.java index 2460a57fb6..28b147da98 100644 --- a/src/org/thoughtcrime/securesms/dependencies/SignalCommunicationModule.java +++ b/src/org/thoughtcrime/securesms/dependencies/SignalCommunicationModule.java @@ -46,7 +46,7 @@ import org.thoughtcrime.securesms.jobs.TypingSendJob; import org.thoughtcrime.securesms.linkpreview.LinkPreviewRepository; import org.thoughtcrime.securesms.logging.Log; import org.thoughtcrime.securesms.loki.protocol.LokiSessionResetImplementation; -import org.thoughtcrime.securesms.loki.MultiDeviceOpenGroupUpdateJob; +import org.thoughtcrime.securesms.loki.protocol.MultiDeviceOpenGroupUpdateJob; import org.thoughtcrime.securesms.loki.PushMessageSyncSendJob; import org.thoughtcrime.securesms.preferences.AppProtectionPreferenceFragment; import org.thoughtcrime.securesms.push.MessageSenderEventListener; diff --git a/src/org/thoughtcrime/securesms/jobs/JobManagerFactories.java b/src/org/thoughtcrime/securesms/jobs/JobManagerFactories.java index 5300f461fd..667b003e7e 100644 --- a/src/org/thoughtcrime/securesms/jobs/JobManagerFactories.java +++ b/src/org/thoughtcrime/securesms/jobs/JobManagerFactories.java @@ -13,7 +13,7 @@ import org.thoughtcrime.securesms.jobmanager.impl.NetworkConstraintObserver; import org.thoughtcrime.securesms.jobmanager.impl.NetworkOrCellServiceConstraint; import org.thoughtcrime.securesms.jobmanager.impl.SqlCipherMigrationConstraint; import org.thoughtcrime.securesms.jobmanager.impl.SqlCipherMigrationConstraintObserver; -import org.thoughtcrime.securesms.loki.MultiDeviceOpenGroupUpdateJob; +import org.thoughtcrime.securesms.loki.protocol.MultiDeviceOpenGroupUpdateJob; import org.thoughtcrime.securesms.loki.PushBackgroundMessageSendJob; import org.thoughtcrime.securesms.loki.PushMessageSyncSendJob; diff --git a/src/org/thoughtcrime/securesms/jobs/MultiDeviceContactUpdateJob.java b/src/org/thoughtcrime/securesms/jobs/MultiDeviceContactUpdateJob.java index 583deb244a..43af6a4aa6 100644 --- a/src/org/thoughtcrime/securesms/jobs/MultiDeviceContactUpdateJob.java +++ b/src/org/thoughtcrime/securesms/jobs/MultiDeviceContactUpdateJob.java @@ -122,7 +122,7 @@ public class MultiDeviceContactUpdateJob extends BaseJob implements InjectableTy } if (address == null) generateFullContactUpdate(); - else if (!SyncMessagesProtocol.shouldSyncContact(context, Address.fromSerialized(address))) generateSingleContactUpdate(Address.fromSerialized(address)); + else if (SyncMessagesProtocol.shouldSyncContact(context, Address.fromSerialized(address))) generateSingleContactUpdate(Address.fromSerialized(address)); } private void generateSingleContactUpdate(@NonNull Address address) diff --git a/src/org/thoughtcrime/securesms/jobs/MultiDeviceGroupUpdateJob.java b/src/org/thoughtcrime/securesms/jobs/MultiDeviceGroupUpdateJob.java index 921bbb899c..677ee4e947 100644 --- a/src/org/thoughtcrime/securesms/jobs/MultiDeviceGroupUpdateJob.java +++ b/src/org/thoughtcrime/securesms/jobs/MultiDeviceGroupUpdateJob.java @@ -84,7 +84,7 @@ public class MultiDeviceGroupUpdateJob extends BaseJob implements InjectableType reader = DatabaseFactory.getGroupDatabase(context).getGroups(); while ((record = reader.getNext()) != null) { - if (record.isSignalGroup()) { + if (record.isClosedGroup()) { List members = new LinkedList<>(); List admins = new LinkedList<>(); diff --git a/src/org/thoughtcrime/securesms/jobs/PushMediaSendJob.java b/src/org/thoughtcrime/securesms/jobs/PushMediaSendJob.java index f685abf100..29802525e5 100644 --- a/src/org/thoughtcrime/securesms/jobs/PushMediaSendJob.java +++ b/src/org/thoughtcrime/securesms/jobs/PushMediaSendJob.java @@ -63,9 +63,8 @@ public class PushMediaSendJob extends PushSendJob implements InjectableType { private static final String KEY_TEMPLATE_MESSAGE_ID = "template_message_id"; private static final String KEY_MESSAGE_ID = "message_id"; private static final String KEY_DESTINATION = "destination"; - private static final String KEY_IS_FRIEND_REQUEST = "is_friend_request"; + private static final String KEY_IS_LOKI_PRE_KEY_BUNDLE_MESSAGE = "is_friend_request"; private static final String KEY_CUSTOM_FR_MESSAGE = "custom_friend_request_message"; - private static final String KEY_SHOULD_SEND_SYNC_MESSAGE = "should_send_sync_message"; @Inject SignalServiceMessageSender messageSender; @@ -148,7 +147,7 @@ public class PushMediaSendJob extends PushSendJob implements InjectableType { .putLong(KEY_TEMPLATE_MESSAGE_ID, templateMessageId) .putLong(KEY_MESSAGE_ID, messageId) .putString(KEY_DESTINATION, destination.serialize()) - .putBoolean(KEY_IS_FRIEND_REQUEST, isLokiPreKeyBundleMessage); + .putBoolean(KEY_IS_LOKI_PRE_KEY_BUNDLE_MESSAGE, isLokiPreKeyBundleMessage); if (customFriendRequestMessage != null) { builder.putString(KEY_CUSTOM_FR_MESSAGE, customFriendRequestMessage); } return builder.build(); @@ -326,7 +325,7 @@ public class PushMediaSendJob extends PushSendJob implements InjectableType { long templateMessageID = data.getLong(KEY_TEMPLATE_MESSAGE_ID); long messageID = data.getLong(KEY_MESSAGE_ID); Address destination = Address.fromSerialized(data.getString(KEY_DESTINATION)); - boolean isLokiPreKeyBundleMessage = data.getBoolean(KEY_IS_FRIEND_REQUEST); + boolean isLokiPreKeyBundleMessage = data.getBoolean(KEY_IS_LOKI_PRE_KEY_BUNDLE_MESSAGE); String customFRMessage = data.hasString(KEY_CUSTOM_FR_MESSAGE) ? data.getString(KEY_CUSTOM_FR_MESSAGE) : null; return new PushMediaSendJob(parameters, templateMessageID, messageID, destination, isLokiPreKeyBundleMessage, customFRMessage); } diff --git a/src/org/thoughtcrime/securesms/jobs/PushTextSendJob.java b/src/org/thoughtcrime/securesms/jobs/PushTextSendJob.java index 4374cfe35c..26ad07bee7 100644 --- a/src/org/thoughtcrime/securesms/jobs/PushTextSendJob.java +++ b/src/org/thoughtcrime/securesms/jobs/PushTextSendJob.java @@ -47,9 +47,8 @@ public class PushTextSendJob extends PushSendJob implements InjectableType { private static final String KEY_TEMPLATE_MESSAGE_ID = "template_message_id"; private static final String KEY_MESSAGE_ID = "message_id"; private static final String KEY_DESTINATION = "destination"; - private static final String KEY_IS_FRIEND_REQUEST = "is_friend_request"; + private static final String KEY_IS_LOKI_PRE_KEY_BUNDLE_MESSAGE = "is_friend_request"; private static final String KEY_CUSTOM_FR_MESSAGE = "custom_friend_request_message"; - private static final String KEY_SHOULD_SEND_SYNC_MESSAGE = "should_send_sync_message"; @Inject SignalServiceMessageSender messageSender; @@ -88,7 +87,7 @@ public class PushTextSendJob extends PushSendJob implements InjectableType { .putLong(KEY_TEMPLATE_MESSAGE_ID, templateMessageId) .putLong(KEY_MESSAGE_ID, messageId) .putString(KEY_DESTINATION, destination.serialize()) - .putBoolean(KEY_IS_FRIEND_REQUEST, isLokiPreKeyBundleMessage); + .putBoolean(KEY_IS_LOKI_PRE_KEY_BUNDLE_MESSAGE, isLokiPreKeyBundleMessage); if (customFriendRequestMessage != null) { builder.putString(KEY_CUSTOM_FR_MESSAGE, customFriendRequestMessage); } return builder.build(); @@ -262,7 +261,7 @@ public class PushTextSendJob extends PushSendJob implements InjectableType { long templateMessageID = data.getLong(KEY_TEMPLATE_MESSAGE_ID); long messageID = data.getLong(KEY_MESSAGE_ID); Address destination = Address.fromSerialized(data.getString(KEY_DESTINATION)); - boolean isLokiPreKeyBundleMessage = data.getBoolean(KEY_IS_FRIEND_REQUEST); + boolean isLokiPreKeyBundleMessage = data.getBoolean(KEY_IS_LOKI_PRE_KEY_BUNDLE_MESSAGE); String customFRMessage = data.hasString(KEY_CUSTOM_FR_MESSAGE) ? data.getString(KEY_CUSTOM_FR_MESSAGE) : null; return new PushTextSendJob(parameters, templateMessageID, messageID, destination, isLokiPreKeyBundleMessage, customFRMessage); } diff --git a/src/org/thoughtcrime/securesms/jobs/RefreshPreKeysJob.java b/src/org/thoughtcrime/securesms/jobs/RefreshPreKeysJob.java index 584584e662..5d9cae36ef 100644 --- a/src/org/thoughtcrime/securesms/jobs/RefreshPreKeysJob.java +++ b/src/org/thoughtcrime/securesms/jobs/RefreshPreKeysJob.java @@ -64,7 +64,7 @@ public class RefreshPreKeysJob extends BaseJob implements InjectableType { return; } - List preKeyRecords = PreKeyUtil.generatePreKeys(context); + List preKeyRecords = PreKeyUtil.generatePreKeyRecords(context); IdentityKeyPair identityKey = IdentityKeyUtil.getIdentityKeyPair(context); SignedPreKeyRecord signedPreKeyRecord = PreKeyUtil.generateSignedPreKey(context, identityKey, false); diff --git a/src/org/thoughtcrime/securesms/jobs/RotateSignedPreKeyJob.java b/src/org/thoughtcrime/securesms/jobs/RotateSignedPreKeyJob.java index 363fb2c8b8..aae3816e75 100644 --- a/src/org/thoughtcrime/securesms/jobs/RotateSignedPreKeyJob.java +++ b/src/org/thoughtcrime/securesms/jobs/RotateSignedPreKeyJob.java @@ -55,6 +55,7 @@ public class RotateSignedPreKeyJob extends BaseJob implements InjectableType { IdentityKeyPair identityKey = IdentityKeyUtil.getIdentityKeyPair(context); SignedPreKeyRecord signedPreKeyRecord = PreKeyUtil.generateSignedPreKey(context, identityKey, false); + // Loki - Don't upload the new signed pre key // accountManager.setSignedPreKey(signedPreKeyRecord); PreKeyUtil.setActiveSignedPreKeyId(context, signedPreKeyRecord.getId()); diff --git a/src/org/thoughtcrime/securesms/loki/database/LokiPreKeyRecordDatabase.kt b/src/org/thoughtcrime/securesms/loki/database/LokiPreKeyRecordDatabase.kt index 700b8cd32f..934368c085 100644 --- a/src/org/thoughtcrime/securesms/loki/database/LokiPreKeyRecordDatabase.kt +++ b/src/org/thoughtcrime/securesms/loki/database/LokiPreKeyRecordDatabase.kt @@ -38,7 +38,7 @@ class LokiPreKeyRecordDatabase(context: Context, helper: SQLCipherOpenHelper) : } private fun generateAndStorePreKeyRecord(hexEncodedPublicKey: String): PreKeyRecord { - val records = PreKeyUtil.generatePreKeys(context, 1) + val records = PreKeyUtil.generatePreKeyRecords(context, 1) PreKeyUtil.storePreKeyRecords(context, records) val record = records.first() val database = databaseHelper.writableDatabase diff --git a/src/org/thoughtcrime/securesms/loki/MultiDeviceOpenGroupUpdateJob.kt b/src/org/thoughtcrime/securesms/loki/protocol/MultiDeviceOpenGroupUpdateJob.kt similarity index 89% rename from src/org/thoughtcrime/securesms/loki/MultiDeviceOpenGroupUpdateJob.kt rename to src/org/thoughtcrime/securesms/loki/protocol/MultiDeviceOpenGroupUpdateJob.kt index a39a976db9..ee53934038 100644 --- a/src/org/thoughtcrime/securesms/loki/MultiDeviceOpenGroupUpdateJob.kt +++ b/src/org/thoughtcrime/securesms/loki/protocol/MultiDeviceOpenGroupUpdateJob.kt @@ -1,4 +1,4 @@ -package org.thoughtcrime.securesms.loki +package org.thoughtcrime.securesms.loki.protocol import org.thoughtcrime.securesms.crypto.UnidentifiedAccessUtil import org.thoughtcrime.securesms.database.DatabaseFactory @@ -32,7 +32,8 @@ class MultiDeviceOpenGroupUpdateJob private constructor(parameters: Parameters) .setMaxAttempts(Parameters.UNLIMITED) .build()) - override fun getFactoryKey(): String { return KEY } + override fun getFactoryKey(): String { return KEY + } override fun serialize(): Data { return Data.EMPTY } @@ -47,19 +48,16 @@ class MultiDeviceOpenGroupUpdateJob private constructor(parameters: Parameters) DatabaseFactory.getGroupDatabase(context).groups.use { reader -> while (true) { val record = reader.next ?: return@use - if (!record.isPublicChat) { continue; } + if (!record.isOpenGroup) { continue; } val threadID = GroupManager.getThreadIDFromGroupID(record.encodedId, context) val openGroup = DatabaseFactory.getLokiThreadDatabase(context).getPublicChat(threadID) - if (openGroup != null) { - openGroups.add(openGroup) - } + if (openGroup != null) { openGroups.add(openGroup) } } } if (openGroups.size > 0) { - messageSender.sendMessage(SignalServiceSyncMessage.forOpenGroups(openGroups), - UnidentifiedAccessUtil.getAccessForSync(context)) + messageSender.sendMessage(SignalServiceSyncMessage.forOpenGroups(openGroups), UnidentifiedAccessUtil.getAccessForSync(context)) } else { Log.d("Loki", "No open groups to sync.") } diff --git a/src/org/thoughtcrime/securesms/preferences/widgets/ProfilePreference.java b/src/org/thoughtcrime/securesms/preferences/widgets/ProfilePreference.java index 0455a3cd3c..b48e8c4021 100644 --- a/src/org/thoughtcrime/securesms/preferences/widgets/ProfilePreference.java +++ b/src/org/thoughtcrime/securesms/preferences/widgets/ProfilePreference.java @@ -80,16 +80,16 @@ public class ProfilePreference extends Preference { if (profileNumberView == null) return; Context context = getContext(); - String userHexEncodedPublicKey = TextSecurePreferences.getLocalNumber(context); - String primaryDevicePublicKey = TextSecurePreferences.getMasterHexEncodedPublicKey(context); - String publicKey = primaryDevicePublicKey != null ? primaryDevicePublicKey : userHexEncodedPublicKey; - final Address localAddress = Address.fromSerialized(publicKey); - final Recipient recipient = Recipient.from(context, localAddress, false); - final String profileName = TextSecurePreferences.getProfileName(context); + String userPublicKey = TextSecurePreferences.getLocalNumber(context); + String masterPublicKey = TextSecurePreferences.getMasterHexEncodedPublicKey(context); + String publicKeyToUse = masterPublicKey != null ? masterPublicKey : userPublicKey; + final Address address = Address.fromSerialized(publicKeyToUse); + final Recipient recipient = Recipient.from(context, address, false); + final String displayName = TextSecurePreferences.getProfileName(context); containerView.setOnLongClickListener(v -> { ClipboardManager clipboard = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE); - ClipData clip = ClipData.newPlainText("Public Key", publicKey); + ClipData clip = ClipData.newPlainText("Public Key", publicKeyToUse); clipboard.setPrimaryClip(clip); Toast.makeText(context, R.string.activity_settings_public_key_copied_message, Toast.LENGTH_SHORT).show(); return true; @@ -114,17 +114,17 @@ public class ProfilePreference extends Preference { .into(avatarView); - if (!TextUtils.isEmpty(profileName)) { - profileNameView.setText(profileName); + if (!TextUtils.isEmpty(displayName)) { + profileNameView.setText(displayName); } - profileNameView.setVisibility(TextUtils.isEmpty(profileName) ? View.GONE : View.VISIBLE); - profileNumberView.setText(localAddress.toPhoneString()); + profileNameView.setVisibility(TextUtils.isEmpty(displayName) ? View.GONE : View.VISIBLE); + profileNumberView.setText(address.toPhoneString()); - profileTagView.setVisibility(primaryDevicePublicKey == null ? View.GONE : View.VISIBLE); - if (primaryDevicePublicKey != null && ourDeviceWords == null) { + profileTagView.setVisibility(masterPublicKey == null ? View.GONE : View.VISIBLE); + if (masterPublicKey != null && ourDeviceWords == null) { MnemonicCodec codec = new MnemonicCodec(MnemonicUtilities.getLanguageFileDirectory(context)); - ourDeviceWords = MnemonicUtilities.getFirst3Words(codec, userHexEncodedPublicKey); + ourDeviceWords = MnemonicUtilities.getFirst3Words(codec, userPublicKey); } String tag = context.getResources().getString(R.string.activity_settings_linked_device_tag); diff --git a/src/org/thoughtcrime/securesms/registration/WelcomeActivity.java b/src/org/thoughtcrime/securesms/registration/WelcomeActivity.java index bb8ba95ebc..cfa8d6e810 100644 --- a/src/org/thoughtcrime/securesms/registration/WelcomeActivity.java +++ b/src/org/thoughtcrime/securesms/registration/WelcomeActivity.java @@ -58,8 +58,6 @@ public class WelcomeActivity extends BaseActionBarActivity { .ifNecessary() .withRationaleDialog(getString(R.string.activity_landing_permission_dialog_message), R.drawable.ic_folder_white_48dp) .onAnyResult(() -> { -// TextSecurePreferences.setHasSeenWelcomeScreen(WelcomeActivity.this, true); - Intent nextIntent = getIntent().getParcelableExtra("next_intent"); if (nextIntent == null) { diff --git a/src/org/thoughtcrime/securesms/service/WebRtcCallService.java b/src/org/thoughtcrime/securesms/service/WebRtcCallService.java index 4e55462221..0de3ac406f 100644 --- a/src/org/thoughtcrime/securesms/service/WebRtcCallService.java +++ b/src/org/thoughtcrime/securesms/service/WebRtcCallService.java @@ -1010,7 +1010,6 @@ public class WebRtcCallService extends Service implements InjectableType, Callable callable = new Callable() { @Override public Boolean call() throws Exception { - // TODO: Message ID messageSender.sendCallMessage(new SignalServiceAddress(recipient.getAddress().toPhoneString()), UnidentifiedAccessUtil.getAccessFor(WebRtcCallService.this, recipient), callMessage); diff --git a/src/org/thoughtcrime/securesms/sms/MessageSender.java b/src/org/thoughtcrime/securesms/sms/MessageSender.java index 8d07dbe41a..390656ea56 100644 --- a/src/org/thoughtcrime/securesms/sms/MessageSender.java +++ b/src/org/thoughtcrime/securesms/sms/MessageSender.java @@ -47,7 +47,7 @@ import org.thoughtcrime.securesms.linkpreview.LinkPreviewUtil; import org.thoughtcrime.securesms.logging.Log; import org.thoughtcrime.securesms.loki.BackgroundMessage; import org.thoughtcrime.securesms.loki.FriendRequestHandler; -import org.thoughtcrime.securesms.loki.MultiDeviceOpenGroupUpdateJob; +import org.thoughtcrime.securesms.loki.protocol.MultiDeviceOpenGroupUpdateJob; import org.thoughtcrime.securesms.loki.MultiDeviceUtilities; import org.thoughtcrime.securesms.loki.PushBackgroundMessageSendJob; import org.thoughtcrime.securesms.loki.PushMessageSyncSendJob; diff --git a/src/org/thoughtcrime/securesms/util/IdentityUtil.java b/src/org/thoughtcrime/securesms/util/IdentityUtil.java index 56dff28e6a..ae712c9f71 100644 --- a/src/org/thoughtcrime/securesms/util/IdentityUtil.java +++ b/src/org/thoughtcrime/securesms/util/IdentityUtil.java @@ -6,7 +6,6 @@ import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.annotation.StringRes; -import network.loki.messenger.R; import org.thoughtcrime.securesms.crypto.storage.TextSecureIdentityKeyStore; import org.thoughtcrime.securesms.crypto.storage.TextSecureSessionStore; import org.thoughtcrime.securesms.database.Address; @@ -39,6 +38,8 @@ import org.whispersystems.signalservice.api.messages.multidevice.VerifiedMessage import java.util.List; +import network.loki.messenger.R; + import static org.whispersystems.libsignal.SessionCipher.SESSION_LOCK; public class IdentityUtil { @@ -74,7 +75,7 @@ public class IdentityUtil { GroupDatabase.GroupRecord groupRecord; while ((groupRecord = reader.getNext()) != null) { - if (groupRecord.isRSSFeed() || groupRecord.isPublicChat()) { continue; } + if (groupRecord.isRSSFeed() || groupRecord.isOpenGroup()) { continue; } if (groupRecord.getMembers().contains(recipient.getAddress()) && groupRecord.isActive() && !groupRecord.isMms()) { SignalServiceGroup group = new SignalServiceGroup(groupRecord.getId(), SignalServiceGroup.GroupType.SIGNAL); @@ -127,7 +128,7 @@ public class IdentityUtil { GroupDatabase.GroupRecord groupRecord; while ((groupRecord = reader.getNext()) != null) { - if (groupRecord.isRSSFeed() || groupRecord.isPublicChat()) { continue; } + if (groupRecord.isRSSFeed() || groupRecord.isOpenGroup()) { continue; } if (groupRecord.getMembers().contains(recipient.getAddress()) && groupRecord.isActive()) { SignalServiceGroup group = new SignalServiceGroup(groupRecord.getId(), SignalServiceGroup.GroupType.SIGNAL); IncomingTextMessage incoming = new IncomingTextMessage(recipient.getAddress(), 1, time, null, Optional.of(group), 0, false);