stfalcon-studio/ChatKit

message deleting issue

Asadpt opened this issue · 4 comments

Hi All,
I am using the latest version(v0.4.1) of chatkit library for my android chat app.
I am facing an issue while deleting chat.
selected message is not deleting. latest message gets deleted..
i have added code snippet below..

Capture

fun initAdapter() {

    val holders = MessageHolders()
        .registerContentType(
            CONTENT_TYPE_VOICE, IncomingVoiceMessageViewHolder::class.java, R.layout.item_custom_incoming_voice_message,
            OutcomingVoiceMessageViewHolder::class.java, R.layout.item_custom_outcoming_voice_message, this
        )
    
    adapter = MessagesListAdapter<moschoolingCorp.parents.model.IMessage>("ffd07a01-450c-49a4-b565-13ff47616212", holders, imgLoader)
    messageRecyleview?.setAdapter(adapter)
    addChatInputListener()
    adapter?.setOnMessageClickListener(MessagesListAdapter.OnMessageClickListener {
        adapter?.delete(it)
    })
}

I had tried both adapter.delete(it) and adapter?.deleteById("dhfsdfs")
But both not working...

hi, did u hold data with adapter data? did it's match exactly position, next time check the message u got when get from OnMessaegeClickListenerCallback

@fre5h
Thanks for your comment.

It was mistake from my side. Message id was same for all message..
Now It is working fine.
I am closing this issue..

Thank you very much