diff --git a/src/config.cpp b/src/config.cpp index 6676219..234ab33 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -109,7 +109,7 @@ std::uint16_t read_config(string &instance, string &access_token, string &feedur cerr << "Error code: " << ret << '\n'; return ret; } - + } if (feedurl.empty()) { @@ -177,7 +177,7 @@ std::uint16_t read_config(string &instance, string &access_token, string &feedur } -const bool write_config() +bool write_config() { std::ofstream outfile(filepath + "config-" + profile + ".json"); if (outfile.is_open()) diff --git a/src/http.cpp b/src/http.cpp index b3f52ab..71c0bd8 100644 --- a/src/http.cpp +++ b/src/http.cpp @@ -1,6 +1,6 @@ /* This file is part of mastorss. - * Copyright © 2018 tastytea - * + * Copyright © 2018, 2019 tastytea + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 3. @@ -37,7 +37,8 @@ void curlpp_init() curlpp::initialize(); } -const std::uint16_t http_get(const string &feedurl, string &answer, const string &useragent) +std::uint16_t http_get(const string &feedurl, string &answer, + const string &useragent) { try { @@ -51,7 +52,7 @@ const std::uint16_t http_get(const string &feedurl, string &answer, const string }); request.setOpt(true); request.setOpt(&oss); - + request.perform(); std::uint16_t ret = curlpp::infos::ResponseCode::get(request); if (ret == 200 || ret == 302 || ret == 307) diff --git a/src/mastorss.hpp b/src/mastorss.hpp index e03263b..7d9a6e8 100644 --- a/src/mastorss.hpp +++ b/src/mastorss.hpp @@ -1,3 +1,19 @@ +/* This file is part of mastorss. + * Copyright © 2018, 2019 tastytea + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #ifndef mastorss_HPP #define mastorss_HPP @@ -15,12 +31,12 @@ extern Json::Value config; extern std::string profile; std::uint16_t read_config(string &instance, string &access_token, string &feedurl); -const bool write_config(); +bool write_config(); std::vector parse_feed(const string &xml); void individual_fixes(string &str); -const std::uint16_t http_get(const string &feedurl, +std::uint16_t http_get(const string &feedurl, string &answer, const string &useragent = ""); void curlpp_init();