Added support for refreshing the device list, marking current device with a checkmark instead of a lock

This commit is contained in:
Thulinma 2021-09-19 22:55:12 +02:00
parent acc257ea06
commit 456a41bcdf
8 changed files with 72 additions and 8 deletions

View file

@ -151,6 +151,15 @@ UserProfile::isSelf() const
return this->userid_ == utils::localUser();
}
void
UserProfile::refreshDevices()
{
std::vector<std::string> keysToRequest;
keysToRequest.push_back(this->userid_.toStdString());
cache::client()->markUserKeysOutOfDate(keysToRequest);
fetchDeviceList(this->userid_);
}
void
UserProfile::fetchDeviceList(const QString &userID)
{
@ -205,6 +214,9 @@ UserProfile::fetchDeviceList(const QString &userID)
device, DeviceId(device.device_id), UserId(other_user_id)))
verified = verification::Status::VERIFIED;
if (isSelf() && device.device_id == ::http::client()->device_id())
verified = verification::Status::SELF;
deviceInfo.push_back(
{QString::fromStdString(d.first),
QString::fromStdString(device.unsigned_info.device_display_name),