mirror of
https://gitee.com/Zhaoxin59/my-chat_-client.git
synced 2026-02-14 00:51:48 +08:00
add updateFriendList from network
This commit is contained in:
@ -163,4 +163,30 @@ namespace model
|
||||
myself->load(userInfo);
|
||||
}
|
||||
|
||||
QList<UserInfo>* DataCenter::getFriendList()
|
||||
{
|
||||
return friendList;
|
||||
}
|
||||
|
||||
void DataCenter::getFriendListAsync()
|
||||
{
|
||||
netClient.getFriendList(loginSessionId);
|
||||
}
|
||||
|
||||
void DataCenter::resetFriendList(std::shared_ptr<bite_im::GetFriendListRsp> resp)
|
||||
{
|
||||
if (friendList == nullptr) {
|
||||
friendList = new QList<UserInfo>();
|
||||
}
|
||||
friendList->clear();
|
||||
|
||||
QList<bite_im::UserInfo> friendListPB = resp->friendList();
|
||||
for (auto& f : friendListPB) {
|
||||
UserInfo userInfo;
|
||||
userInfo.load(f);
|
||||
friendList->push_back(userInfo);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} //end namespace model
|
||||
|
||||
Reference in New Issue
Block a user