2018-02-27 23:38:05 +01:00
|
|
|
/* This file is part of mastobotmon.
|
|
|
|
* Copyright © 2018 tastytea <tastytea@tastytea.de>
|
|
|
|
*
|
|
|
|
* 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 <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef mastobotmon_HPP
|
|
|
|
#define mastobotmon_HPP
|
|
|
|
|
2018-02-28 06:23:42 +01:00
|
|
|
#include <string>
|
|
|
|
#include <cstdint>
|
2018-03-07 09:21:13 +01:00
|
|
|
#include <jsoncpp/json/json.h>
|
2018-02-28 06:23:42 +01:00
|
|
|
#include <mastodon-cpp.hpp>
|
|
|
|
|
|
|
|
using std::uint16_t;
|
|
|
|
using std::string;
|
2018-02-27 23:38:05 +01:00
|
|
|
|
2018-03-07 18:33:13 +01:00
|
|
|
extern Json::Value config;
|
|
|
|
|
2018-02-28 06:23:42 +01:00
|
|
|
class Account : public Mastodon::API
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
explicit Account(const string &instance, const string &access_token);
|
2018-03-02 06:11:18 +01:00
|
|
|
const void set_minutes(uint16_t minutes);
|
|
|
|
const uint16_t get_minutes() const;
|
2018-03-07 11:41:16 +01:00
|
|
|
const uint16_t get_mentions(string &answer);
|
|
|
|
const void set_last_mention_id(const std::uint64_t &id);
|
2018-02-28 06:23:42 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
uint16_t _minutes;
|
2018-03-07 11:41:16 +01:00
|
|
|
std::uint64_t _last_mention_id;
|
2018-02-28 06:23:42 +01:00
|
|
|
};
|
2018-02-27 23:38:05 +01:00
|
|
|
|
2018-03-07 18:33:13 +01:00
|
|
|
const bool read_config();
|
2018-03-07 11:41:16 +01:00
|
|
|
const string get_access_token(const string &account);
|
2018-03-07 18:33:13 +01:00
|
|
|
const bool add_account();
|
|
|
|
const bool write_config();
|
2018-03-07 11:41:16 +01:00
|
|
|
|
2018-03-07 18:33:13 +01:00
|
|
|
const bool write_mentions(const string &straccount, Json::Value &mentions);
|
2018-03-07 11:41:16 +01:00
|
|
|
|
2018-02-27 23:38:05 +01:00
|
|
|
#endif // mastobotmon_HPP
|