This commit is contained in:
Niels Andriesse 2020-02-04 14:20:42 +11:00
parent 75cd2d6d28
commit 3e5c6126a3
2 changed files with 7 additions and 0 deletions

View File

@ -72,6 +72,8 @@ class HomeActivity : PassphraseRequiredActionBarActivity, ConversationClickListe
deleteThreadAtCurrentPosition() deleteThreadAtCurrentPosition()
} }
} }
// Double check that the long poller is up
(applicationContext as ApplicationContext).startLongPollingIfNeeded()
// Set content view // Set content view
setContentView(R.layout.activity_home) setContentView(R.layout.activity_home)
// Set custom toolbar // Set custom toolbar

View File

@ -13,6 +13,7 @@ import android.widget.TextView
import com.github.ybq.android.spinkit.style.DoubleBounce import com.github.ybq.android.spinkit.style.DoubleBounce
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.loki.getColorWithID import org.thoughtcrime.securesms.loki.getColorWithID
import org.thoughtcrime.securesms.loki.toPx import org.thoughtcrime.securesms.loki.toPx
@ -120,6 +121,10 @@ class FriendRequestView(context: Context, attrs: AttributeSet?, defStyleAttr: In
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
val friendRequestStatus = lokiMessageDatabase.getFriendRequestStatus(message.id) val friendRequestStatus = lokiMessageDatabase.getFriendRequestStatus(message.id)
if (message is MediaMmsMessageRecord) {
visibility = View.GONE
return
}
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
buttonLinearLayout.visibility = if (friendRequestStatus != LokiMessageFriendRequestStatus.REQUEST_PENDING) View.GONE else View.VISIBLE buttonLinearLayout.visibility = if (friendRequestStatus != LokiMessageFriendRequestStatus.REQUEST_PENDING) View.GONE else View.VISIBLE