65 immer::array<User>
results()
const;
89 , std::string _accessToken
91 std::string searchTerm , std::optional<int> limit = std::nullopt
111 using namespace Kazv;
118 if (! jo.is_object()) { jo = json::object(); }
121 jo[
"user_id"s] = pod.
userId;
132 if (jo.contains(
"user_id"s)) {
133 result.
userId = jo.at(
"user_id"s);
135 if (jo.contains(
"display_name"s)) {
138 if (jo.contains(
"avatar_url"s)) {
bool limited() const
Indicates if the result list has been truncated by the limit.
Definition: users.cpp:101
JobResponse(Response r)
Definition: users.cpp:75
immer::array< User > results() const
Ordered by rank and then whether or not profile info is available.
Definition: users.cpp:90
bool success() const
Definition: users.cpp:78
Searches the user directory.
Definition: users.hpp:25
static BaseJob::Query buildQuery()
Definition: users.cpp:13
SearchUserDirectoryJob(std::string serverUrl, std::string _accessToken, std::string searchTerm, std::optional< int > limit=std::nullopt)
Searches the user directory.
Definition: users.cpp:41
static constexpr auto needsAuth()
Definition: users.hpp:72
static BaseJob::Body buildBody(std::string searchTerm, std::optional< int > limit)
Definition: users.cpp:21
SearchUserDirectoryJob withData(JsonWrap j) &&
Definition: users.cpp:61
Definition: basejob.hpp:91
Definition: basejob.hpp:77
::Kazv::Body Body
Definition: basejob.hpp:100
Definition: jsonwrap.hpp:23
Definition: location.hpp:10
Definition: location.hpp:10
void addToJsonIfNeeded(json &j, std::string name, T &&arg)
Definition: types.hpp:80
nlohmann::json json
Definition: jsonwrap.hpp:20
Definition: location.hpp:27
Performs a search for users.
Definition: users.hpp:40
std::optional< std::string > avatarUrl
The avatar url, as an MXC, if one exists.
Definition: users.hpp:46
std::optional< std::string > displayName
The display name of the user, if one exists.
Definition: users.hpp:44
std::string userId
The user's matrix user ID.
Definition: users.hpp:42
Definition: basejob.hpp:50
static void to_json(json &jo, const SearchUserDirectoryJob::User &pod)
Definition: users.hpp:116
static void from_json(const json &jo, SearchUserDirectoryJob::User &result)
Definition: users.hpp:129