mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-24 02:25:19 +00:00
Merge branch 'dev' of https://github.com/oxen-io/session-android into screenlock-timeout
This commit is contained in:
commit
2c85fbf91b
@ -45,7 +45,7 @@ class LinkDeviceActivity : BaseActionBarActivity(), ScanQRCodeWrapperFragmentDel
|
|||||||
private var restoreJob: Job? = null
|
private var restoreJob: Job? = null
|
||||||
|
|
||||||
override fun onBackPressed() {
|
override fun onBackPressed() {
|
||||||
if (restoreJob?.isActive == true) return // don't allow going back with pending job
|
if (restoreJob?.isActive == true) return // Don't allow going back with a pending job
|
||||||
super.onBackPressed()
|
super.onBackPressed()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,14 +53,12 @@ class LinkDeviceActivity : BaseActionBarActivity(), ScanQRCodeWrapperFragmentDel
|
|||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
setUpActionBarSessionLogo()
|
setUpActionBarSessionLogo()
|
||||||
// Set the registration sync variables
|
|
||||||
TextSecurePreferences.apply {
|
TextSecurePreferences.apply {
|
||||||
setHasViewedSeed(this@LinkDeviceActivity, true)
|
setHasViewedSeed(this@LinkDeviceActivity, true)
|
||||||
setConfigurationMessageSynced(this@LinkDeviceActivity, false)
|
setConfigurationMessageSynced(this@LinkDeviceActivity, false)
|
||||||
setRestorationTime(this@LinkDeviceActivity, System.currentTimeMillis())
|
setRestorationTime(this@LinkDeviceActivity, System.currentTimeMillis())
|
||||||
setLastProfileUpdateTime(this@LinkDeviceActivity, 0)
|
setLastProfileUpdateTime(this@LinkDeviceActivity, 0)
|
||||||
}
|
}
|
||||||
// registration variables are synced
|
|
||||||
setContentView(R.layout.activity_link_device)
|
setContentView(R.layout.activity_link_device)
|
||||||
viewPager.adapter = adapter
|
viewPager.adapter = adapter
|
||||||
tabLayout.setupWithViewPager(viewPager)
|
tabLayout.setupWithViewPager(viewPager)
|
||||||
|
@ -30,14 +30,12 @@ class RecoveryPhraseRestoreActivity : BaseActionBarActivity() {
|
|||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
setUpActionBarSessionLogo()
|
setUpActionBarSessionLogo()
|
||||||
// Set the registration sync variables
|
|
||||||
TextSecurePreferences.apply {
|
TextSecurePreferences.apply {
|
||||||
setHasViewedSeed(this@RecoveryPhraseRestoreActivity, true)
|
setHasViewedSeed(this@RecoveryPhraseRestoreActivity, true)
|
||||||
setConfigurationMessageSynced(this@RecoveryPhraseRestoreActivity, false)
|
setConfigurationMessageSynced(this@RecoveryPhraseRestoreActivity, false)
|
||||||
setRestorationTime(this@RecoveryPhraseRestoreActivity, System.currentTimeMillis())
|
setRestorationTime(this@RecoveryPhraseRestoreActivity, System.currentTimeMillis())
|
||||||
setLastProfileUpdateTime(this@RecoveryPhraseRestoreActivity, System.currentTimeMillis())
|
setLastProfileUpdateTime(this@RecoveryPhraseRestoreActivity, System.currentTimeMillis())
|
||||||
}
|
}
|
||||||
// registration variables are synced
|
|
||||||
setContentView(R.layout.activity_recovery_phrase_restore)
|
setContentView(R.layout.activity_recovery_phrase_restore)
|
||||||
mnemonicEditText.imeOptions = mnemonicEditText.imeOptions or 16777216 // Always use incognito keyboard
|
mnemonicEditText.imeOptions = mnemonicEditText.imeOptions or 16777216 // Always use incognito keyboard
|
||||||
restoreButton.setOnClickListener { restore() }
|
restoreButton.setOnClickListener { restore() }
|
||||||
|
@ -39,14 +39,12 @@ class RegisterActivity : BaseActionBarActivity() {
|
|||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
setContentView(R.layout.activity_register)
|
setContentView(R.layout.activity_register)
|
||||||
setUpActionBarSessionLogo()
|
setUpActionBarSessionLogo()
|
||||||
// Set the registration sync variables
|
|
||||||
TextSecurePreferences.apply {
|
TextSecurePreferences.apply {
|
||||||
setHasViewedSeed(this@RegisterActivity, false)
|
setHasViewedSeed(this@RegisterActivity, false)
|
||||||
setConfigurationMessageSynced(this@RegisterActivity, true)
|
setConfigurationMessageSynced(this@RegisterActivity, true)
|
||||||
setRestorationTime(this@RegisterActivity, 0)
|
setRestorationTime(this@RegisterActivity, 0)
|
||||||
setLastProfileUpdateTime(this@RegisterActivity, System.currentTimeMillis())
|
setLastProfileUpdateTime(this@RegisterActivity, System.currentTimeMillis())
|
||||||
}
|
}
|
||||||
// registration variables are synced
|
|
||||||
registerButton.setOnClickListener { register() }
|
registerButton.setOnClickListener { register() }
|
||||||
copyButton.setOnClickListener { copyPublicKey() }
|
copyButton.setOnClickListener { copyPublicKey() }
|
||||||
val termsExplanation = SpannableStringBuilder("By using this service, you agree to our Terms of Service and Privacy Policy")
|
val termsExplanation = SpannableStringBuilder("By using this service, you agree to our Terms of Service and Privacy Policy")
|
||||||
|
@ -98,13 +98,6 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@drawable/home_activity_gradient" />
|
android:background="@drawable/home_activity_gradient" />
|
||||||
|
|
||||||
<org.thoughtcrime.securesms.loki.views.NewConversationButtonSetView
|
|
||||||
android:id="@+id/newConversationButtonSet"
|
|
||||||
android:layout_width="276dp"
|
|
||||||
android:layout_height="236dp"
|
|
||||||
android:layout_centerHorizontal="true"
|
|
||||||
android:layout_alignParentBottom="true" />
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/emptyStateContainer"
|
android:id="@+id/emptyStateContainer"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@ -131,6 +124,13 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<org.thoughtcrime.securesms.loki.views.NewConversationButtonSetView
|
||||||
|
android:id="@+id/newConversationButtonSet"
|
||||||
|
android:layout_width="276dp"
|
||||||
|
android:layout_height="236dp"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_alignParentBottom="true" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
@ -7,10 +7,8 @@ import nl.komponents.kovenant.functional.map
|
|||||||
import org.session.libsession.messaging.MessagingModuleConfiguration
|
import org.session.libsession.messaging.MessagingModuleConfiguration
|
||||||
import org.session.libsession.messaging.jobs.JobQueue
|
import org.session.libsession.messaging.jobs.JobQueue
|
||||||
import org.session.libsession.messaging.jobs.MessageReceiveJob
|
import org.session.libsession.messaging.jobs.MessageReceiveJob
|
||||||
import org.session.libsession.messaging.utilities.MessageWrapper
|
|
||||||
import org.session.libsession.snode.SnodeAPI
|
import org.session.libsession.snode.SnodeAPI
|
||||||
import org.session.libsignal.service.loki.utilities.getRandomElementOrNull
|
import org.session.libsignal.service.loki.utilities.getRandomElementOrNull
|
||||||
import org.session.libsignal.utilities.Base64
|
|
||||||
import org.session.libsignal.utilities.logging.Log
|
import org.session.libsignal.utilities.logging.Log
|
||||||
import org.session.libsignal.utilities.successBackground
|
import org.session.libsignal.utilities.successBackground
|
||||||
|
|
||||||
@ -74,11 +72,8 @@ class ClosedGroupPoller {
|
|||||||
if (messages.isNotEmpty()) {
|
if (messages.isNotEmpty()) {
|
||||||
Log.d("Loki", "Received ${messages.count()} new message(s) in closed group with public key: $publicKey.")
|
Log.d("Loki", "Received ${messages.count()} new message(s) in closed group with public key: $publicKey.")
|
||||||
}
|
}
|
||||||
messages.forEach { message ->
|
messages.forEach { envelope ->
|
||||||
val rawMessageAsJSON = message as? Map<*, *>
|
val job = MessageReceiveJob(envelope.toByteArray(), false)
|
||||||
val base64EncodedData = rawMessageAsJSON?.get("data") as? String
|
|
||||||
val data = base64EncodedData?.let { Base64.decode(it) } ?: return@forEach
|
|
||||||
val job = MessageReceiveJob(MessageWrapper.unwrap(data).toByteArray(), false)
|
|
||||||
JobQueue.shared.add(job)
|
JobQueue.shared.add(job)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,11 +5,9 @@ import nl.komponents.kovenant.functional.bind
|
|||||||
import org.session.libsession.messaging.MessagingModuleConfiguration
|
import org.session.libsession.messaging.MessagingModuleConfiguration
|
||||||
import org.session.libsession.messaging.jobs.JobQueue
|
import org.session.libsession.messaging.jobs.JobQueue
|
||||||
import org.session.libsession.messaging.jobs.MessageReceiveJob
|
import org.session.libsession.messaging.jobs.MessageReceiveJob
|
||||||
import org.session.libsession.messaging.utilities.MessageWrapper
|
|
||||||
import org.session.libsession.snode.SnodeAPI
|
import org.session.libsession.snode.SnodeAPI
|
||||||
import org.session.libsession.snode.SnodeModule
|
import org.session.libsession.snode.SnodeModule
|
||||||
import org.session.libsignal.service.loki.Snode
|
import org.session.libsignal.service.loki.Snode
|
||||||
import org.session.libsignal.utilities.Base64
|
|
||||||
import org.session.libsignal.utilities.logging.Log
|
import org.session.libsignal.utilities.logging.Log
|
||||||
import java.security.SecureRandom
|
import java.security.SecureRandom
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
Loading…
Reference in New Issue
Block a user