package com.bc_chat.im.messages.collection

import io.rong.imkit.IExtensionModule
import io.rong.imkit.RongExtension
import io.rong.imkit.emoticon.IEmoticonTab
import io.rong.imkit.plugin.IPluginModule
import io.rong.imlib.model.Conversation
import io.rong.imlib.model.Message

/**
 * author：Created by zhaohaoting on 2019/3/15
 * email：526309416@qq.com
 * desc：收藏
 */
class CollectionExtensioModule : IExtensionModule {

    private var mTargetId: String? = null
    override fun onInit(appKey: String) {
    }

    override fun onConnect(token: String) {}

    override fun onAttachedToExtension(extension: RongExtension) {
        mTargetId = extension.targetId
    }

    override fun onDetachedFromExtension() {}

    override fun onReceivedMessage(message: Message) {}

    override fun getPluginModules(conversationType: Conversation.ConversationType): List<IPluginModule> {
        val pluginModules = arrayListOf<IPluginModule>()
        val collectionPlugin = CollectionPlugin()
        pluginModules.add(collectionPlugin)
        return pluginModules
    }

    override fun getEmoticonTabs(): List<IEmoticonTab>? {
        return null
    }

    override fun onDisconnect() {}
}