mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-25 11:05:25 +00:00
fix: nts threads
This commit is contained in:
parent
4f534d5a1e
commit
f91fc2503b
@ -248,10 +248,6 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
|
|||||||
// assume created thread
|
// assume created thread
|
||||||
if (recipient.isContactRecipient && !recipient.isLocalNumber) {
|
if (recipient.isContactRecipient && !recipient.isLocalNumber) {
|
||||||
storage.setRecipientApproved(recipient, true) // assume approved when we CREATE the thread, not send first message
|
storage.setRecipientApproved(recipient, true) // assume approved when we CREATE the thread, not send first message
|
||||||
} else if (recipient.isLocalNumber) {
|
|
||||||
// this gets around the filtering of unapproved / unsent threads
|
|
||||||
// since the sql query would have to take into account whether address == local user address
|
|
||||||
threadDb.setHasSent(threadId, true)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} ?: finish()
|
} ?: finish()
|
||||||
|
@ -5,6 +5,7 @@ import android.net.Uri
|
|||||||
import network.loki.messenger.libsession_util.ConfigBase
|
import network.loki.messenger.libsession_util.ConfigBase
|
||||||
import network.loki.messenger.libsession_util.ConfigBase.Companion.PRIORITY_HIDDEN
|
import network.loki.messenger.libsession_util.ConfigBase.Companion.PRIORITY_HIDDEN
|
||||||
import network.loki.messenger.libsession_util.ConfigBase.Companion.PRIORITY_PINNED
|
import network.loki.messenger.libsession_util.ConfigBase.Companion.PRIORITY_PINNED
|
||||||
|
import network.loki.messenger.libsession_util.ConfigBase.Companion.PRIORITY_VISIBLE
|
||||||
import network.loki.messenger.libsession_util.Contacts
|
import network.loki.messenger.libsession_util.Contacts
|
||||||
import network.loki.messenger.libsession_util.ConversationVolatileConfig
|
import network.loki.messenger.libsession_util.ConversationVolatileConfig
|
||||||
import network.loki.messenger.libsession_util.UserGroupsConfig
|
import network.loki.messenger.libsession_util.UserGroupsConfig
|
||||||
@ -95,7 +96,18 @@ open class Storage(context: Context, helper: SQLCipherOpenHelper, private val co
|
|||||||
ThreadDatabase.ConversationThreadUpdateListener {
|
ThreadDatabase.ConversationThreadUpdateListener {
|
||||||
|
|
||||||
override fun threadCreated(address: Address, threadId: Long) {
|
override fun threadCreated(address: Address, threadId: Long) {
|
||||||
if (!getRecipientApproved(address)) return // don't store unapproved / message requests
|
val localUserAddress = getUserPublicKey() ?: return
|
||||||
|
if (!getRecipientApproved(address) && localUserAddress != address.serialize()) return // don't store unapproved / message requests
|
||||||
|
|
||||||
|
if (localUserAddress == address.serialize()) {
|
||||||
|
val userConfig = configFactory.user ?: return
|
||||||
|
if (userConfig.getNtsPriority() == PRIORITY_HIDDEN) {
|
||||||
|
// if it's hidden set it visible, otherwise it's pinned so don't change
|
||||||
|
userConfig.setNtsPriority(PRIORITY_VISIBLE)
|
||||||
|
DatabaseComponent.get(context).threadDatabase().setHasSent(threadId, true)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
val volatile = configFactory.convoVolatile ?: return
|
val volatile = configFactory.convoVolatile ?: return
|
||||||
if (address.isGroup) {
|
if (address.isGroup) {
|
||||||
|
@ -728,6 +728,7 @@ public class ThreadDatabase extends Database {
|
|||||||
new String[] {String.valueOf(threadId)});
|
new String[] {String.valueOf(threadId)});
|
||||||
|
|
||||||
notifyConversationListeners(threadId);
|
notifyConversationListeners(threadId);
|
||||||
|
notifyConversationListListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean update(long threadId, boolean unarchive, boolean shouldDeleteOnEmpty) {
|
public boolean update(long threadId, boolean unarchive, boolean shouldDeleteOnEmpty) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
android.useAndroidX=true
|
android.useAndroidX=true
|
||||||
android.enableJetifier=true
|
android.enableJetifier=true
|
||||||
org.gradle.jvmargs=-Xmx8g
|
org.gradle.jvmargs=-Xmx4g
|
||||||
|
|
||||||
gradlePluginVersion=7.3.1
|
gradlePluginVersion=7.3.1
|
||||||
googleServicesVersion=4.3.12
|
googleServicesVersion=4.3.12
|
||||||
|
Loading…
Reference in New Issue
Block a user