message deleting issue
Asadpt opened this issue · 4 comments
Asadpt commented
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..
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)
})
}
Asadpt commented
I had tried both adapter.delete(it) and adapter?.deleteById("dhfsdfs")
But both not working...
Asadpt commented
@stfalcon @hbmartin @fre5h @philippeauriach please help..
fukemy commented
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