mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-25 11:05:25 +00:00
Merge remote-tracking branch 'origin/libsession-integration' into libsession-integration
This commit is contained in:
commit
7647531146
@ -48,12 +48,12 @@ class UserView : LinearLayout {
|
|||||||
|
|
||||||
// region Updating
|
// region Updating
|
||||||
fun bind(user: Recipient, glide: GlideRequests, actionIndicator: ActionIndicator, isSelected: Boolean = false) {
|
fun bind(user: Recipient, glide: GlideRequests, actionIndicator: ActionIndicator, isSelected: Boolean = false) {
|
||||||
|
val isLocalUser = user.isLocalNumber
|
||||||
fun getUserDisplayName(publicKey: String): String {
|
fun getUserDisplayName(publicKey: String): String {
|
||||||
|
if (isLocalUser) return context.getString(R.string.MessageRecord_you)
|
||||||
val contact = DatabaseComponent.get(context).sessionContactDatabase().getContactWithSessionID(publicKey)
|
val contact = DatabaseComponent.get(context).sessionContactDatabase().getContactWithSessionID(publicKey)
|
||||||
return contact?.displayName(Contact.ContactContext.REGULAR) ?: publicKey
|
return contact?.displayName(Contact.ContactContext.REGULAR) ?: publicKey
|
||||||
}
|
}
|
||||||
val threadID = MessagingModuleConfiguration.shared.storage.getOrCreateThreadIdFor(user.address)
|
|
||||||
MentionManagerUtilities.populateUserPublicKeyCacheIfNeeded(threadID, context) // FIXME: This is a bad place to do this
|
|
||||||
val address = user.address.serialize()
|
val address = user.address.serialize()
|
||||||
binding.profilePictureView.root.glide = glide
|
binding.profilePictureView.root.glide = glide
|
||||||
binding.profilePictureView.root.update(user)
|
binding.profilePictureView.root.update(user)
|
||||||
|
@ -97,6 +97,9 @@ open class Storage(context: Context, helper: SQLCipherOpenHelper, private val co
|
|||||||
// TODO: maybe add time here from formation / creation message
|
// TODO: maybe add time here from formation / creation message
|
||||||
override fun threadCreated(address: Address, threadId: Long) {
|
override fun threadCreated(address: Address, threadId: Long) {
|
||||||
if (!getRecipientApproved(address)) return // don't store unapproved / message requests
|
if (!getRecipientApproved(address)) return // don't store unapproved / message requests
|
||||||
|
if (getUserPublicKey() == address.serialize()) {
|
||||||
|
Log.d("Loki-DBG", "NTS created, context:\n${Thread.currentThread().stackTrace.joinToString("\n")}")
|
||||||
|
}
|
||||||
|
|
||||||
val volatile = configFactory.convoVolatile ?: return
|
val volatile = configFactory.convoVolatile ?: return
|
||||||
if (address.isGroup) {
|
if (address.isGroup) {
|
||||||
|
Loading…
Reference in New Issue
Block a user