package com.rv.im.db.service;

import android.content.Context;

import com.rv.im.db.dao.ConversationDao;
import com.rv.im.db.table.ChatConversation;

import java.util.List;

public class ChatConversationServiceImp implements IChatConversationService {

    private ConversationDao dao = null;

    private static ChatConversationServiceImp instance = null;

    private ChatConversationServiceImp(Context context) {
        dao = ConversationDao.getInstance(context);
    }

    public static ChatConversationServiceImp getInstance(Context context) {
        if (instance == null) {
            instance = new ChatConversationServiceImp(context);
        }
        return instance;
    }

    @Override
    public List<ChatConversation> getAllConversation() {
        return dao.getAllConversation();
    }

    @Override
    public void addMessage(ChatConversation conversation) {

    }

    public void release() {
        instance = null;
    }
}
