|
|
|
@ -32,6 +32,7 @@ import org.thoughtcrime.securesms.database.DatabaseFactory
|
|
|
|
|
import org.thoughtcrime.securesms.database.ThreadDatabase
|
|
|
|
|
import org.thoughtcrime.securesms.database.model.ThreadRecord
|
|
|
|
|
import org.thoughtcrime.securesms.loki.getColorWithID
|
|
|
|
|
import org.thoughtcrime.securesms.loki.redesign.dialogs.PNModeBottomSheet
|
|
|
|
|
import org.thoughtcrime.securesms.loki.redesign.utilities.push
|
|
|
|
|
import org.thoughtcrime.securesms.loki.redesign.utilities.show
|
|
|
|
|
import org.thoughtcrime.securesms.loki.redesign.views.ConversationView
|
|
|
|
@ -156,32 +157,20 @@ class HomeActivity : PassphraseRequiredActionBarActivity, ConversationClickListe
|
|
|
|
|
if (hasViewedSeed || !isMasterDevice) {
|
|
|
|
|
seedReminderView.visibility = View.GONE
|
|
|
|
|
}
|
|
|
|
|
// if (!TextSecurePreferences.getHasSeenOpenGroupSuggestionSheet(this)) {
|
|
|
|
|
// val bottomSheet = OpenGroupSuggestionBottomSheet()
|
|
|
|
|
// bottomSheet.onJoinTapped = {
|
|
|
|
|
// TextSecurePreferences.setHasSeenOpenGroupSuggestionSheet(this)
|
|
|
|
|
// bottomSheet.dismiss()
|
|
|
|
|
// // TODO: Duplication of the code in JoinPublicChatActivity
|
|
|
|
|
// val application = ApplicationContext.getInstance(this)
|
|
|
|
|
// val channel: Long = 1
|
|
|
|
|
// val displayName = TextSecurePreferences.getProfileName(this)
|
|
|
|
|
// val lokiPublicChatAPI = application.lokiPublicChatAPI!!
|
|
|
|
|
// val url = "https://chat.getsession.org"
|
|
|
|
|
// application.lokiPublicChatManager.addChat(url, channel).successUi {
|
|
|
|
|
// lokiPublicChatAPI.getMessages(channel, url)
|
|
|
|
|
// lokiPublicChatAPI.setDisplayName(displayName, url)
|
|
|
|
|
// lokiPublicChatAPI.join(channel, url)
|
|
|
|
|
// val profileKey: ByteArray = ProfileKeyUtil.getProfileKey(this)
|
|
|
|
|
// val profileUrl: String? = TextSecurePreferences.getProfileAvatarUrl(this)
|
|
|
|
|
// lokiPublicChatAPI.setProfilePicture(url, profileKey, profileUrl)
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// bottomSheet.onDismissTapped = {
|
|
|
|
|
// TextSecurePreferences.setHasSeenOpenGroupSuggestionSheet(this)
|
|
|
|
|
// bottomSheet.dismiss()
|
|
|
|
|
// }
|
|
|
|
|
// bottomSheet.show(supportFragmentManager, bottomSheet.tag)
|
|
|
|
|
// }
|
|
|
|
|
if (!TextSecurePreferences.hasSeenPNModeSheet(this)) {
|
|
|
|
|
val bottomSheet = PNModeBottomSheet()
|
|
|
|
|
bottomSheet.onConfirmTapped = { isUsingFCM ->
|
|
|
|
|
TextSecurePreferences.setHasSeenPNModeSheet(this, true)
|
|
|
|
|
TextSecurePreferences.setIsUsingFCM(this, isUsingFCM)
|
|
|
|
|
ApplicationContext.getInstance(this).registerForFCMIfNeeded()
|
|
|
|
|
bottomSheet.dismiss()
|
|
|
|
|
}
|
|
|
|
|
bottomSheet.onSkipTapped = {
|
|
|
|
|
TextSecurePreferences.setHasSeenPNModeSheet(this, true)
|
|
|
|
|
bottomSheet.dismiss()
|
|
|
|
|
}
|
|
|
|
|
bottomSheet.show(supportFragmentManager, bottomSheet.tag)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
|
|
|
|