diff --git a/spectrum/src/frontends/slack/SlackAPI.h b/spectrum/src/frontends/slack/SlackAPI.h index abf2cad37092548dedf49ab87382959b8b746426..f32d4b4583f131e1bd31c81ebd7ca9388fcdc5b0 100644 --- a/spectrum/src/frontends/slack/SlackAPI.h +++ b/spectrum/src/frontends/slack/SlackAPI.h @@ -91,9 +91,17 @@ class SlackAPI : public HTTPRequestQueue { static void getSlackUserInfo(HTTPRequest *req, bool ok, rapidjson::Document &resp, const std::string &data, std::map &users); static std::string SlackObjectToPlainText(const std::string &object, bool isChannel = false, bool returnName = false); + // Creates channel if it does not exist and invites the user to the channel. + typedef boost::function< void (const std::string &channelId) > CreateChannelCallback; + void createChannel(const std::string &channel, const std::string &user, CreateChannelCallback callback); + private: void handleSendMessage(HTTPRequest *req, bool ok, rapidjson::Document &resp, const std::string &data); + void handleSlackChannelCreate(HTTPRequest *req, bool ok, rapidjson::Document &resp, const std::string &data, const std::string &channel, const std::string &user, CreateChannelCallback callback); + void handleSlackChannelList(HTTPRequest *req, bool ok, rapidjson::Document &resp, const std::string &data, const std::string &channel, const std::string &user, CreateChannelCallback callback); + void handleSlackChannelInvite(HTTPRequest *req, bool ok, rapidjson::Document &resp, const std::string &data, const std::string &channel, const std::string &user, CreateChannelCallback callback); + private: Component *m_component; std::string m_token;