handle remaining stuff for Quotient::Omittable deprecation
This commit is contained in:
committed by
Tobias Fella
parent
aec35222f9
commit
ece56a55e8
@@ -255,7 +255,7 @@ QString EventHandler::rawMessageBody(const Quotient::RoomMessageEvent &event)
|
||||
|
||||
QString body;
|
||||
if (event.hasTextContent() && event.content()) {
|
||||
body = static_cast<const MessageEventContent::TextContent *>(event.content())->body;
|
||||
body = static_cast<const EventContent::TextContent *>(event.content())->body;
|
||||
} else {
|
||||
body = event.plainBody();
|
||||
}
|
||||
@@ -479,7 +479,7 @@ QString EventHandler::getMessageBody(const RoomMessageEvent &event, Qt::TextForm
|
||||
|
||||
QString body;
|
||||
if (event.hasTextContent() && event.content()) {
|
||||
body = static_cast<const MessageEventContent::TextContent *>(event.content())->body;
|
||||
body = static_cast<const EventContent::TextContent *>(event.content())->body;
|
||||
} else {
|
||||
body = event.plainBody();
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ ImagePackEventContent::ImagePackEventContent(const QJsonObject &json)
|
||||
fromJson<std::optional<QString>>(json["pack"_ls].toObject()["attribution"_ls]),
|
||||
};
|
||||
} else {
|
||||
pack = none;
|
||||
pack = std::nullopt;
|
||||
}
|
||||
|
||||
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"))) {
|
||||
info = EventContent::ImageInfo(QUrl(json["images"_ls][k]["url"_ls].toString()), json["images"_ls][k]["info"_ls].toObject(), k);
|
||||
} else {
|
||||
info = none;
|
||||
info = std::nullopt;
|
||||
}
|
||||
images += ImagePackImage{
|
||||
k,
|
||||
|
||||
@@ -44,7 +44,7 @@ void SearchModel::search()
|
||||
}
|
||||
|
||||
RoomEventFilter filter;
|
||||
filter.unreadThreadNotifications = none;
|
||||
filter.unreadThreadNotifications = std::nullopt;
|
||||
filter.lazyLoadMembers = true;
|
||||
filter.includeRedundantMembers = false;
|
||||
filter.notRooms = QStringList();
|
||||
@@ -58,7 +58,7 @@ void SearchModel::search()
|
||||
.orderBy = "recent"_ls,
|
||||
.eventContext = SearchJob::IncludeEventContext{3, 3, true},
|
||||
.includeState = false,
|
||||
.groupings = none,
|
||||
.groupings = std::nullopt,
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ QString Registration::recaptchaSiteKey() const
|
||||
void Registration::registerAccount()
|
||||
{
|
||||
setStatus(Working);
|
||||
std::optional<QJsonObject> authData = none;
|
||||
std::optional<QJsonObject> authData = std::nullopt;
|
||||
if (nextStep() == "m.login.recaptcha"_ls) {
|
||||
authData = QJsonObject{
|
||||
{"type"_ls, "m.login.recaptcha"_ls},
|
||||
@@ -176,7 +176,7 @@ void Registration::testHomeserver()
|
||||
if (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]() {
|
||||
if (m_testServerJob->error() == BaseJob::StatusCode::ContentAccessError) {
|
||||
setStatus(ServerNoRegistration);
|
||||
|
||||
@@ -57,7 +57,7 @@ void SpaceHierarchyCache::populateSpaceHierarchy(const QString &spaceId)
|
||||
}
|
||||
|
||||
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);
|
||||
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();
|
||||
if (!nextBatchToken.isEmpty() && nextBatchToken != *m_nextBatchTokens[spaceId]) {
|
||||
*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]() {
|
||||
addBatch(spaceId, nextJob);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user