RoomManager: Unify the resolveResource overloads
Every time I look at how resource resolving works, I always trip over this unused overload. This behaves *different* than the other overload, which has special cases for handling invalid Uris. Now whether you pass in a Uri or a QString, it should behave the same.
This commit is contained in:
@@ -134,16 +134,15 @@ void RoomManager::activateUserModel()
|
||||
m_userListModel->activate();
|
||||
}
|
||||
|
||||
UriResolveResult RoomManager::resolveResource(const Uri &uri)
|
||||
{
|
||||
return UriResolverBase::visitResource(m_connection, uri);
|
||||
}
|
||||
|
||||
void RoomManager::resolveResource(const QString &idOrUri, const QString &action)
|
||||
{
|
||||
Uri uri{idOrUri};
|
||||
resolveResource(Uri{idOrUri}, action);
|
||||
}
|
||||
|
||||
void RoomManager::resolveResource(Uri uri, const QString &action)
|
||||
{
|
||||
if (!uri.isValid()) {
|
||||
Q_EMIT showMessage(MessageType::Warning, i18n("Malformed or empty Matrix id<br />%1 is not a correct Matrix identifier", idOrUri));
|
||||
Q_EMIT showMessage(MessageType::Warning, i18n("Malformed or empty Matrix id<br />%1 is not a correct Matrix identifier", uri.toDisplayString()));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user