handle remaining stuff for Quotient::Omittable deprecation

This commit is contained in:
James Graham
2024-05-05 17:09:25 +01:00
committed by Tobias Fella
parent 15b7c04834
commit 9e05f17cb7
5 changed files with 10 additions and 10 deletions

View File

@@ -255,7 +255,7 @@ QString EventHandler::rawMessageBody(const Quotient::RoomMessageEvent &event)
QString body; QString body;
if (event.hasTextContent() && event.content()) { if (event.hasTextContent() && event.content()) {
body = static_cast<const MessageEventContent::TextContent *>(event.content())->body; body = static_cast<const EventContent::TextContent *>(event.content())->body;
} else { } else {
body = event.plainBody(); body = event.plainBody();
} }
@@ -479,7 +479,7 @@ QString EventHandler::getMessageBody(const RoomMessageEvent &event, Qt::TextForm
QString body; QString body;
if (event.hasTextContent() && event.content()) { if (event.hasTextContent() && event.content()) {
body = static_cast<const MessageEventContent::TextContent *>(event.content())->body; body = static_cast<const EventContent::TextContent *>(event.content())->body;
} else { } else {
body = event.plainBody(); body = event.plainBody();
} }

View File

@@ -16,7 +16,7 @@ ImagePackEventContent::ImagePackEventContent(const QJsonObject &json)
fromJson<std::optional<QString>>(json["pack"_ls].toObject()["attribution"_ls]), fromJson<std::optional<QString>>(json["pack"_ls].toObject()["attribution"_ls]),
}; };
} else { } else {
pack = none; pack = std::nullopt;
} }
const auto &keys = json["images"_ls].toObject().keys(); const auto &keys = json["images"_ls].toObject().keys();
@@ -25,7 +25,7 @@ ImagePackEventContent::ImagePackEventContent(const QJsonObject &json)
if (json["images"_ls][k].toObject().contains(QStringLiteral("info"))) { if (json["images"_ls][k].toObject().contains(QStringLiteral("info"))) {
info = EventContent::ImageInfo(QUrl(json["images"_ls][k]["url"_ls].toString()), json["images"_ls][k]["info"_ls].toObject(), k); info = EventContent::ImageInfo(QUrl(json["images"_ls][k]["url"_ls].toString()), json["images"_ls][k]["info"_ls].toObject(), k);
} else { } else {
info = none; info = std::nullopt;
} }
images += ImagePackImage{ images += ImagePackImage{
k, k,

View File

@@ -44,7 +44,7 @@ void SearchModel::search()
} }
RoomEventFilter filter; RoomEventFilter filter;
filter.unreadThreadNotifications = none; filter.unreadThreadNotifications = std::nullopt;
filter.lazyLoadMembers = true; filter.lazyLoadMembers = true;
filter.includeRedundantMembers = false; filter.includeRedundantMembers = false;
filter.notRooms = QStringList(); filter.notRooms = QStringList();
@@ -58,7 +58,7 @@ void SearchModel::search()
.orderBy = "recent"_ls, .orderBy = "recent"_ls,
.eventContext = SearchJob::IncludeEventContext{3, 3, true}, .eventContext = SearchJob::IncludeEventContext{3, 3, true},
.includeState = false, .includeState = false,
.groupings = none, .groupings = std::nullopt,
}; };

View File

@@ -63,7 +63,7 @@ QString Registration::recaptchaSiteKey() const
void Registration::registerAccount() void Registration::registerAccount()
{ {
setStatus(Working); setStatus(Working);
std::optional<QJsonObject> authData = none; std::optional<QJsonObject> authData = std::nullopt;
if (nextStep() == "m.login.recaptcha"_ls) { if (nextStep() == "m.login.recaptcha"_ls) {
authData = QJsonObject{ authData = QJsonObject{
{"type"_ls, "m.login.recaptcha"_ls}, {"type"_ls, "m.login.recaptcha"_ls},
@@ -176,7 +176,7 @@ void Registration::testHomeserver()
if (m_testServerJob) { if (m_testServerJob) {
delete m_testServerJob; delete m_testServerJob;
} }
m_testServerJob = m_connection->callApi<NeoChatRegisterJob>("user"_ls, none, "user"_ls, QString(), QString(), QString(), false); m_testServerJob = m_connection->callApi<NeoChatRegisterJob>("user"_ls, std::nullopt, "user"_ls, QString(), QString(), QString(), false);
connect(m_testServerJob.data(), &BaseJob::finished, this, [this]() { connect(m_testServerJob.data(), &BaseJob::finished, this, [this]() {
if (m_testServerJob->error() == BaseJob::StatusCode::ContentAccessError) { if (m_testServerJob->error() == BaseJob::StatusCode::ContentAccessError) {
setStatus(ServerNoRegistration); setStatus(ServerNoRegistration);

View File

@@ -57,7 +57,7 @@ void SpaceHierarchyCache::populateSpaceHierarchy(const QString &spaceId)
} }
m_nextBatchTokens[spaceId] = QString(); m_nextBatchTokens[spaceId] = QString();
auto job = m_connection->callApi<GetSpaceHierarchyJob>(spaceId, none, none, none, *m_nextBatchTokens[spaceId]); auto job = m_connection->callApi<GetSpaceHierarchyJob>(spaceId, std::nullopt, std::nullopt, std::nullopt, *m_nextBatchTokens[spaceId]);
auto group = KConfigGroup(KSharedConfig::openStateConfig("SpaceHierarchy"_ls), "Cache"_ls); auto group = KConfigGroup(KSharedConfig::openStateConfig("SpaceHierarchy"_ls), "Cache"_ls);
m_spaceHierarchy.insert(spaceId, group.readEntry(spaceId, QStringList())); m_spaceHierarchy.insert(spaceId, group.readEntry(spaceId, QStringList()));
@@ -86,7 +86,7 @@ void SpaceHierarchyCache::addBatch(const QString &spaceId, Quotient::GetSpaceHie
const auto nextBatchToken = job->nextBatch(); const auto nextBatchToken = job->nextBatch();
if (!nextBatchToken.isEmpty() && nextBatchToken != *m_nextBatchTokens[spaceId]) { if (!nextBatchToken.isEmpty() && nextBatchToken != *m_nextBatchTokens[spaceId]) {
*m_nextBatchTokens[spaceId] = nextBatchToken; *m_nextBatchTokens[spaceId] = nextBatchToken;
auto nextJob = m_connection->callApi<GetSpaceHierarchyJob>(spaceId, none, none, none, *m_nextBatchTokens[spaceId]); auto nextJob = m_connection->callApi<GetSpaceHierarchyJob>(spaceId, std::nullopt, std::nullopt, std::nullopt, *m_nextBatchTokens[spaceId]);
connect(nextJob, &BaseJob::success, this, [this, nextJob, spaceId]() { connect(nextJob, &BaseJob::success, this, [this, nextJob, spaceId]() {
addBatch(spaceId, nextJob); addBatch(spaceId, nextJob);
}); });