5 #include <Quotient/jobs/basejob.h>
25 explicit SetPresenceJob(
const QString& userId,
const QString& presence,
26 const QString& statusMsg = {});
36 explicit GetPresenceJob(
const QString& userId);
42 static QUrl makeRequestUrl(
const HomeserverData& hsData,
const QString& userId);
47 QString presence()
const {
return loadFromJson<QString>(
"presence"_L1); }
51 std::optional<
int> lastActiveAgo()
const
53 return loadFromJson<std::optional<
int>>(
"last_active_ago"_L1);
57 QString statusMsg()
const {
return loadFromJson<QString>(
"status_msg"_L1); }
60 std::optional<
bool> currentlyActive()
const
62 return loadFromJson<std::optional<
bool>>(
"currently_active"_L1);
71 std::optional<
int> lastActiveAgo{};
77 std::optional<
bool> currentlyActive{};
81 template <std::derived_from<GetPresenceJob> JobT>
82 constexpr inline auto doCollectResponse<JobT> = [](JobT* j) -> GetPresenceJob::Response {
83 return { j->presence(), j->lastActiveAgo(), j->statusMsg(), j->currentlyActive() };