| 105 | } |
| 106 | |
| 107 | std::string FSecure::Dropbox::CreateChannel(std::string const& channelName) |
| 108 | { |
| 109 | std::map<std::string, std::string> channels = this->ListChannels(); |
| 110 | |
| 111 | if (channels.find(channelName) == channels.end()) |
| 112 | { |
| 113 | std::string url = OBF("https://api.dropboxapi.com/2/files/create_folder_v2"); |
| 114 | |
| 115 | json j; |
| 116 | j[OBF("path")] = OBF("/") + channelName; |
| 117 | j[OBF("autorename")] = false; |
| 118 | |
| 119 | json response = SendJsonRequest(url, j); |
| 120 | |
| 121 | if (!response[OBF("metadata")].contains(OBF("name"))) |
| 122 | throw std::runtime_error(OBF("Throwing exception: unable to create channel\n")); |
| 123 | } |
| 124 | return channelName; |
| 125 | } |
| 126 | |
| 127 | std::map<std::string, std::string> FSecure::Dropbox::GetMessagesByDirection(std::string const& direction) |
| 128 | { |
nothing calls this directly
no test coverage detected