Changeset - 57a0ebde1dd1
[Not reviewed]
0 1 0
Jan Kaluza - 10 years ago 2016-01-24 12:19:08
jkaluza@redhat.com
Slack: use client instead of rtm:start...
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
spectrum/src/frontends/slack/SlackUserRegistration.cpp
Show inline comments
 
@@ -59,25 +59,25 @@ SlackUserRegistration::SlackUserRegistration(Component *component, UserManager *
 

	
 
SlackUserRegistration::~SlackUserRegistration(){
 
	
 
}
 

	
 
std::string SlackUserRegistration::createOAuth2URL(const std::vector<std::string> &args) {
 
	std::string redirect_url = "https://slack.spectrum.im/oauth2/" + CONFIG_STRING(m_config, "service.jid");
 
	OAuth2 *oauth2 = new OAuth2(CONFIG_STRING_DEFAULTED(m_config, "service.client_id",""),
 
						  CONFIG_STRING_DEFAULTED(m_config, "service.client_secret",""),
 
						  "https://slack.com/oauth/authorize",
 
						  "https://slack.com/api/oauth.access",
 
						  redirect_url,
 
						  "channels:read channels:write team:read im:read im:write chat:write:bot rtm:stream");
 
						  "channels:read channels:write team:read im:read im:write chat:write:bot client");
 
	std::string url = oauth2->generateAuthURL();
 

	
 
	m_auths[oauth2->getState()] = oauth2;
 
	m_authsData[oauth2->getState()] = args;
 

	
 
	return url;
 
}
 

	
 
std::string SlackUserRegistration::getTeamDomain(const std::string &token) {
 
	std::string url = "https://slack.com/api/team.info?token=" + Util::urlencode(token);
 

	
 
	rapidjson::Document resp;
0 comments (0 inline, 0 general)