This commit is contained in:
Niels Andriesse 2019-09-09 16:04:06 +10:00
parent 66c2e0d448
commit 9d76b8bdf7

View File

@ -11,7 +11,6 @@ import android.widget.ProgressBar
import android.widget.TextView import android.widget.TextView
import network.loki.messenger.R import network.loki.messenger.R
import org.thoughtcrime.securesms.database.DatabaseFactory import org.thoughtcrime.securesms.database.DatabaseFactory
import org.thoughtcrime.securesms.database.model.MediaMmsMessageRecord
import org.thoughtcrime.securesms.database.model.MessageRecord import org.thoughtcrime.securesms.database.model.MessageRecord
import org.thoughtcrime.securesms.database.model.SmsMessageRecord import org.thoughtcrime.securesms.database.model.SmsMessageRecord
import org.whispersystems.signalservice.loki.messaging.LokiMessageFriendRequestStatus import org.whispersystems.signalservice.loki.messaging.LokiMessageFriendRequestStatus
@ -109,12 +108,8 @@ class FriendRequestView(context: Context, attrs: AttributeSet?, defStyleAttr: In
val lokiMessageDatabase = DatabaseFactory.getLokiMessageDatabase(context) val lokiMessageDatabase = DatabaseFactory.getLokiMessageDatabase(context)
val contactID = DatabaseFactory.getThreadDatabase(context).getRecipientForThreadId(message!!.threadId)!!.address.toString() val contactID = DatabaseFactory.getThreadDatabase(context).getRecipientForThreadId(message!!.threadId)!!.address.toString()
val contactDisplayName = DatabaseFactory.getLokiUserDatabase(context).getDisplayName(contactID) ?: contactID val contactDisplayName = DatabaseFactory.getLokiUserDatabase(context).getDisplayName(contactID) ?: contactID
if (message is MediaMmsMessageRecord && message.quote != null) { visibility = View.GONE; return }
val isTextMessage = message is SmsMessageRecord val isTextMessage = message is SmsMessageRecord
if (!isTextMessage) { if (!isTextMessage) { visibility = View.GONE; return }
visibility = View.GONE
return
}
val friendRequestStatus = lokiMessageDatabase.getFriendRequestStatus(message.id) val friendRequestStatus = lokiMessageDatabase.getFriendRequestStatus(message.id)
if (!message.isOutgoing) { if (!message.isOutgoing) {
visibility = if (friendRequestStatus == LokiMessageFriendRequestStatus.NONE) View.GONE else View.VISIBLE visibility = if (friendRequestStatus == LokiMessageFriendRequestStatus.NONE) View.GONE else View.VISIBLE