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

Method CreateChannel

Src/Common/FSecure/Github/GithubApi.cpp:77–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77std::string FSecure::GithubApi::CreateChannel(std::string const& channelName)
78{
79 std::map<std::string, std::int64_t> channels = this->ListChannels();
80
81 if (channels.find(channelName) == channels.end())
82 {
83 json j;
84 j[OBF("name")] = channelName;
85 j[OBF("auto_init")] = true;
86 j[OBF("private")] = true;
87
88 auto response = SendJsonRequest(OBF("https://api.github.com/user/repos"), j, Method::POST);
89
90 if (response.contains(OBF("message")))
91 throw std::runtime_error(OBF("Github: unable to create channel - ") + response[OBF("message")]);
92 }
93
94 return channelName;
95}
96
97FSecure::ByteVector FSecure::GithubApi::ReadFile(std::string const& fileDownloadURL)
98{

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