fix: add name update in action bar on modified, change where approvedMe is set

This commit is contained in:
jubb 2022-03-09 14:23:44 +11:00
parent ca7b27f82b
commit 023424a87b
3 changed files with 9 additions and 2 deletions

View File

@ -585,6 +585,7 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
updateSubtitle()
showOrHideInputIfNeeded()
actionBarBinding?.profilePictureView?.update(recipient)
actionBarBinding?.conversationTitleView?.text = recipient.toShortString()
}
}

View File

@ -124,6 +124,14 @@ class Storage(context: Context, helper: SQLCipherOpenHelper) : Database(context,
senderAddress
}
val targetRecipient = Recipient.from(context, targetAddress, false)
if (!targetRecipient.isGroupRecipient) {
val recipientDb = DatabaseComponent.get(context).recipientDatabase()
if (isUserSender) {
recipientDb.setApproved(targetRecipient, true)
} else {
recipientDb.setApprovedMe(targetRecipient, true)
}
}
if (message.isMediaMessage() || attachments.isNotEmpty()) {
val quote: Optional<QuoteModel> = if (quotes != null) Optional.of(quotes) else Optional.absent()
val linkPreviews: Optional<List<LinkPreview>> = if (linkPreview.isEmpty()) Optional.absent() else Optional.of(linkPreview.mapNotNull { it!! })

View File

@ -208,8 +208,6 @@ fun MessageReceiver.handleVisibleMessage(message: VisibleMessage, proto: SignalS
profileManager.setUnidentifiedAccessMode(context, recipient, Recipient.UnidentifiedAccessMode.UNKNOWN)
profileManager.setProfilePictureURL(context, recipient, profile.profilePictureURL!!)
}
// set approved on receive message
storage.setRecipientApprovedMe(recipient, true)
}
// Parse quote if needed
var quoteModel: QuoteModel? = null