Check authInfo before doing getDeviceList request

This commit is contained in:
Christophe Deschamps 2026-03-24 08:42:41 +01:00 committed by Gaelle Braud
parent e077320c97
commit 04e79a63ea

View file

@ -81,8 +81,14 @@ void AccountDeviceList::refreshDevices() {
auto requestDeviceList = [this] {
if (!mAccountManagerServicesModelConnection) return;
mAccountManagerServicesModelConnection->invokeToModel([this]() {
auto identityAddress = mAccountCore->getModel()->getMonitor()->getParams()->getIdentityAddress();
auto authinfo = mAccountCore->getModel()->getMonitor()->findAuthInfo();
auto account = mAccountCore->getModel()->getMonitor();
auto identityAddress = account->getParams()->getIdentityAddress();
auto authinfo = account->findAuthInfo();
if (!authinfo) {
lWarning() << "[AccountDeviceList] No auth info found for address"
<< identityAddress->asStringUriOnly() << ", skipping device list request";
return;
}
qDebug() << "[AccountDeviceList] request devices for address" << identityAddress->asStringUriOnly();
mAccountManagerServicesModel->getDeviceList(identityAddress);
});