send the number to Thread activity too, use it if necessary

This commit is contained in:
tibbi 2020-04-14 09:58:19 +02:00
parent b231f2c644
commit ab9aa5d2ba
3 changed files with 15 additions and 0 deletions

View file

@ -80,6 +80,19 @@ class ThreadActivity : SimpleActivity() {
messages.first().participants
}
if (participants.isEmpty()) {
val name = intent.getStringExtra(THREAD_TITLE) ?: ""
val number = intent.getStringExtra(THREAD_NUMBER)
if (number == null) {
toast(R.string.unknown_error_occurred)
finish()
return@ensureBackgroundThread
}
val contact = Contact(0, name, "", number)
participants.add(contact)
}
messages.filter { it.attachment != null }.forEach {
it.attachment!!.attachments.forEach {
try {