diff --git a/backends/twitter/TwitterPlugin.cpp b/backends/twitter/TwitterPlugin.cpp index 27c13e1c03731f2dd172aa5b76a99d4c34c543c5..e6a0d52eac3fdaaecec7a2e4fdba6cce6efab146 100644 --- a/backends/twitter/TwitterPlugin.cpp +++ b/backends/twitter/TwitterPlugin.cpp @@ -41,20 +41,29 @@ TwitterPlugin::TwitterPlugin(Config *config, Swift::SimpleEventLoop *loop, Stora this->config = config; this->storagebackend = storagebackend; - if(CONFIG_HAS_KEY(config, "twitter.consumer_key") == false || - CONFIG_HAS_KEY(config, "twitter.consumer_secret") == false) { - LOG4CXX_ERROR(logger, "Couldn't find consumer key and/or secret. Please check config file."); - exit(0); + if (CONFIG_HAS_KEY(config, "twitter.consumer_key") == false) { + consumerKey = "5mFePMiJi0KpeURONkelg"; } - + else { + consumerKey = CONFIG_STRING(config, "twitter.consumer_key"); + } + if (CONFIG_HAS_KEY(config, "twitter.consumer_secret") == false) { + consumerSecret = "YFZCDJwRhbkccXEnaYr1waCQejTJcOY8F7l5Wim3FA"; + } + else { + consumerSecret = CONFIG_STRING(config, "twitter.consumer_secret"); + } + + if (consumerSecret.empty() || consumerKey.empty()) { + LOG4CXX_ERROR(logger, "Consumer key and Consumer secret can't be empty."); + exit(1); + } + adminLegacyName = "twitter.com"; adminChatRoom = "#twitter"; adminNickName = "twitter"; adminAlias = "twitter"; - consumerKey = CONFIG_STRING(config, "twitter.consumer_key"); - consumerSecret = CONFIG_STRING(config, "twitter.consumer_secret"); - OAUTH_KEY = "twitter_oauth_token"; OAUTH_SECRET = "twitter_oauth_secret"; MODE = "mode";