add updateFriendList from network

This commit is contained in:
xyz
2025-06-11 19:38:09 +08:00
parent 24536ca80f
commit e4ec73b510
8 changed files with 118 additions and 4 deletions

View File

@ -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