| 325 | } |
| 326 | |
| 327 | bool NetworkService::getUserList(std::vector<UserTO>& result, bool withRetry) |
| 328 | { |
| 329 | log(Priority::Important, "network: get user list"); |
| 330 | |
| 331 | httplib::SSLClient client(_serverAddress); |
| 332 | configureClient(client); |
| 333 | |
| 334 | try { |
| 335 | httplib::Params params; |
| 336 | auto postResult = executeRequest([&] { return client.Post("/alien-server/getuserlist.php", params); }, withRetry); |
| 337 | |
| 338 | std::stringstream stream(postResult->body); |
| 339 | boost::property_tree::ptree tree; |
| 340 | boost::property_tree::read_json(stream, tree); |
| 341 | result.clear(); |
| 342 | result = NetworkResourceParserService::get().decodeUserData(tree); |
| 343 | for (UserTO& userData : result) { |
| 344 | userData.timeSpent = userData.timeSpent * RefreshInterval / 60; |
| 345 | } |
| 346 | return true; |
| 347 | } catch (...) { |
| 348 | logNetworkError(); |
| 349 | return false; |
| 350 | } |
| 351 | } |
| 352 | |
| 353 | bool NetworkService::getEmojiTypeByResourceId(std::unordered_map<std::string, int>& result) |
| 354 | { |
no test coverage detected