mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Removed toast when entering conversation + improved chat message notification pending intent
This commit is contained in:
parent
43d5e8ff23
commit
834f8f7d7e
2 changed files with 12 additions and 19 deletions
|
|
@ -30,6 +30,7 @@ import android.content.Intent
|
|||
import android.content.pm.PackageManager
|
||||
import android.graphics.Bitmap
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import androidx.annotation.AnyThread
|
||||
import androidx.annotation.MainThread
|
||||
import androidx.annotation.WorkerThread
|
||||
|
|
@ -1199,18 +1200,17 @@ class NotificationsManager @MainThread constructor(private val context: Context)
|
|||
|
||||
@WorkerThread
|
||||
private fun getChatRoomPendingIntent(chatRoom: ChatRoom): PendingIntent {
|
||||
val mainActivityIntent = Intent(context, MainActivity::class.java)
|
||||
mainActivityIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
|
||||
mainActivityIntent.setAction(Intent.ACTION_MAIN)
|
||||
mainActivityIntent.putExtra("Chat", true)
|
||||
mainActivityIntent.putExtra("RemoteSipUri", chatRoom.peerAddress.asStringUriOnly())
|
||||
mainActivityIntent.putExtra("LocalSipUri", chatRoom.localAddress.asStringUriOnly())
|
||||
return PendingIntent.getActivity(
|
||||
context,
|
||||
0,
|
||||
mainActivityIntent,
|
||||
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
|
||||
)
|
||||
val args = Bundle()
|
||||
args.putBoolean("Chat", true)
|
||||
args.putString("RemoteSipUri", chatRoom.peerAddress.asStringUriOnly())
|
||||
args.putString("LocalSipUri", chatRoom.localAddress.asStringUriOnly())
|
||||
|
||||
return NavDeepLinkBuilder(context)
|
||||
.setComponentName(MainActivity::class.java)
|
||||
.setGraph(R.navigation.main_nav_graph)
|
||||
.setDestination(R.id.conversationsListFragment)
|
||||
.setArguments(args)
|
||||
.createPendingIntent()
|
||||
}
|
||||
|
||||
class Notifiable(val notificationId: Int) {
|
||||
|
|
|
|||
|
|
@ -326,13 +326,6 @@ class ConversationFragment : SlidingPaneChildFragment() {
|
|||
(requireActivity() as MainActivity).showRedToast(message, R.drawable.x)
|
||||
}
|
||||
} else {
|
||||
if (viewModel.isEndToEndEncrypted.value == true) {
|
||||
Log.i("$TAG Conversation is end-to-end encrypted, showing toast")
|
||||
val message = getString(R.string.toast_end_to_end_encrypted_conversation)
|
||||
val icon = R.drawable.media_encryption_srtp
|
||||
(requireActivity() as MainActivity).showBlueToast(message, icon)
|
||||
}
|
||||
|
||||
sendMessageViewModel.configureChatRoom(viewModel.chatRoom)
|
||||
|
||||
// Wait for chat room to be ready before trying to forward a message in it
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue