| 86 | } |
| 87 | |
| 88 | std::map<std::string, std::string> FSecure::Dropbox::ListChannels() |
| 89 | { |
| 90 | std::map<std::string, std::string> channelMap; |
| 91 | std::string url = OBF("https://api.dropboxapi.com/2/files/list_folder"); |
| 92 | json j; |
| 93 | j[OBF("path")] = OBF(""); // Read from the root of the directory |
| 94 | |
| 95 | json response = SendJsonRequest(url, j); |
| 96 | |
| 97 | for (auto& channel : response[OBF("entries")]) |
| 98 | { |
| 99 | std::string item_type = channel[OBF(".tag")]; |
| 100 | if (item_type == OBF("folder")) |
| 101 | channelMap.emplace(channel[OBF("name")], channel[OBF("id")]); |
| 102 | } |
| 103 | |
| 104 | return channelMap; |
| 105 | } |
| 106 | |
| 107 | std::string FSecure::Dropbox::CreateChannel(std::string const& channelName) |
| 108 | { |