Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The Android recipient user will be allowed to edit the sender's message. #5192

Open
openxcellhitesh opened this issue Mar 1, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@openxcellhitesh
Copy link

Describe the bug
The Android recipient user will be allowed to edit the sender's message.

So as this is bug can you please remove this option for edit the sender's message.
This is also not functioning :)

Check below screenshots for reference purpose.

Screenshot_20240301_160757

SDK version

  • 5.17.21

To Reproduce
Steps to reproduce the behaviour

  1. Go to message view
  2. Click on long press to sender's message.
  3. Scroll down to see the option for edit

Expected behavior
this edit option need to hide

Device:

  • All Device
  • For all version

Screenshots
If applicable, add screenshots to help explain your problem.

@openxcellhitesh openxcellhitesh added the bug Something isn't working label Mar 1, 2024
@DanielNovak
Copy link
Contributor

We are not able to reproduce in our default sample apps (Compose and XML). Are you maybe calling setOwnCapabilities() anywhere in code and adding ChannelCapabilities.UPDATE_ANY_MESSAGE?

@openxcellhitesh
Copy link
Author

Hello Daniel,

Thank you for response but we are not use this in our code still same issue we found.

FInd below code we implemented

 val factory = MessageListViewModelFactory(channelId)
        val messageListHeaderViewModel: MessageListHeaderViewModel by viewModels { factory }
        val messageListViewModel: MessageListViewModel by viewModels { factory }
        val messageInoutViewModel: MessageInputViewModel by viewModels { factory }

        // Set view factory for Imgur attachments
        val imgurAttachmentViewFactory = ImgurAttachmentViewFactory()
        val attachmentViewFactory = AttachmentFactoryManager(listOf(imgurAttachmentViewFactory))
        if (!mBinding.messageListView.isAdapterInitialized())
            mBinding.messageListView.setAttachmentFactoryManager(attachmentViewFactory)

        // Step 2 - Bind the view and ViewModels, they are loosely coupled so it's easy to customize
        messageListHeaderViewModel.bindView(mBinding.messageListHeaderView, this)
        messageListViewModel.bindView(mBinding.messageListView, this)
        messageInoutViewModel.bindView(mBinding.messageInputView, this)

//        // Step 3 - Let both MessageListHeaderView and MessageInputView know when we open a thread
//        // Note: the observe syntax used here requires Kotlin 1.4

        messageListViewModel.mode.observe(viewLifecycleOwner) { mode ->
            when (mode) {
                is MessageListViewModel.Mode.Thread -> {
                    messageListHeaderViewModel.setActiveThread(mode.parentMessage)
                    messageInoutViewModel.setActiveThread(mode.parentMessage)
                }

                MessageListViewModel.Mode.Normal -> {
                    messageListHeaderViewModel.resetThread()
                    messageInoutViewModel.resetThread()
                }
            }
        }

        // Step 5 - Let the message input know when we are editing a message
        mBinding.messageListView.setMessageEditHandler(messageInoutViewModel::editMessage)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants