mirror of
https://gitee.com/Zhaoxin59/my-chat_-client.git
synced 2026-02-14 00:51:48 +08:00
add Message received
This commit is contained in:
@ -142,6 +142,27 @@ namespace model
|
||||
file.close();
|
||||
}
|
||||
|
||||
void DataCenter::clearUnread(const QString& chatSessionId)
|
||||
{
|
||||
(*unreadMessageCount)[chatSessionId] = 0;
|
||||
|
||||
//手动保存一下结果到文件中
|
||||
saveDataFile();
|
||||
}
|
||||
|
||||
void DataCenter::addUnread(const QString& chatSessionId)
|
||||
{
|
||||
++(*unreadMessageCount)[chatSessionId];
|
||||
|
||||
//手动保存一下结果到文件
|
||||
saveDataFile();
|
||||
}
|
||||
|
||||
int DataCenter::getUnread(const QString& chatSessionId)
|
||||
{
|
||||
return (*unreadMessageCount)[chatSessionId];
|
||||
}
|
||||
|
||||
void DataCenter::getMyselfAsync()
|
||||
{
|
||||
//DataCenter 只是负责“处理数据”,
|
||||
@ -239,9 +260,9 @@ namespace model
|
||||
}
|
||||
}
|
||||
|
||||
void DataCenter::getRecnetMessageListAsync(const QString& chatSessionId)
|
||||
void DataCenter::getRecnetMessageListAsync(const QString& chatSessionId, bool updateUI)
|
||||
{
|
||||
netClient.getRecentMessageList(loginSessionId, chatSessionId);
|
||||
netClient.getRecentMessageList(loginSessionId, chatSessionId, updateUI);
|
||||
}
|
||||
|
||||
QList<Message>* DataCenter::getRecentMessageList(const QString& chatSessionId)
|
||||
|
||||
@ -87,6 +87,15 @@ namespace model
|
||||
//从数据文件中加载数据到内存
|
||||
void loadDataFile();
|
||||
|
||||
//清空未读消息数目
|
||||
void clearUnread(const QString& chatSessionId);
|
||||
|
||||
//增加未读消息的数目
|
||||
void addUnread(const QString& chatSessionId);
|
||||
|
||||
//获取未读消息的数目
|
||||
int getUnread(const QString& chatSessionId);
|
||||
|
||||
//获取到当前的登录会话Id
|
||||
const QString& getLoginSessionId() const{
|
||||
return loginSessionId;
|
||||
@ -118,7 +127,7 @@ namespace model
|
||||
void resetApplyList(std::shared_ptr<bite_im::GetPendingFriendEventListRsp> resp);
|
||||
|
||||
//获取最近的消息列表
|
||||
void getRecnetMessageListAsync(const QString& chatSessionId);
|
||||
void getRecnetMessageListAsync(const QString& chatSessionId, bool updateUI);
|
||||
QList<Message>* getRecentMessageList(const QString& chatSessionId);
|
||||
void resetRecentMessageList(const QString& chatSessionId, std::shared_ptr<bite_im::GetRecentMsgRsp> resp);
|
||||
|
||||
@ -149,7 +158,9 @@ namespace model
|
||||
void getChatSessionListDone();
|
||||
void getApplyListDone();
|
||||
void getRecentMessageListDone(const QString& chatSessionId);
|
||||
void getRecentMessageListDoneNoUI(const QString& chatSessionId);
|
||||
void sendMessageDone(MessageType messageType, const QByteArray& content, const QString& extraInfo);
|
||||
void updateLastMessage(const QString& chatSessionId);
|
||||
void receiveMessageDone(const Message& lastMessage);
|
||||
};
|
||||
} //end namespace model
|
||||
|
||||
Reference in New Issue
Block a user