MCPcopy Create free account
hub / github.com/ReversecLabs/C3 / CreateChannel

Method CreateChannel

Src/Common/FSecure/Dropbox/DropboxApi.cpp:107–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105}
106
107std::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
127std::map<std::string, std::string> FSecure::Dropbox::GetMessagesByDirection(std::string const& direction)
128{

Callers

nothing calls this directly

Calls 4

ListChannelsMethod · 0.95
containsMethod · 0.80
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected