package com.bc_chat.im.adapter

import android.content.Context
import io.rong.imkit.model.UIMessage

/**
 * author：Created by zhaohaoting on 2019/2/26
 * email：526309416@qq.com
 * desc：自定义消息列表
 */
class TopMessageListAdapterEx(var mContext: Context, var lordId: String) : MessageListAdapter(mContext) {

    override fun addCollection(collection: MutableCollection<UIMessage>?) {
        super.addCollection(collection?.filter {
            it.senderUserId.equals(lordId)
        })
    }

    override fun addCollection(vararg collection: UIMessage?) {
        super.addCollection(collection?.filter {
            it?.senderUserId.equals(lordId)
        })
    }

    override fun add(t: UIMessage?) {
        if (t?.senderUserId.equals(lordId)) {
            super.add(t)
        }
    }

    override fun add(t: UIMessage?, position: Int) {
        if (t?.senderUserId.equals(lordId)) {
            super.add(t, position)
        }
    }
}