mastodon-cpp  0.110.0
relationship.hpp
1 /* This file is part of mastodon-cpp.
2  * Copyright © 2018, 2019 tastytea <tastytea@tastytea.de>
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Affero General Public License as published by
6  * the Free Software Foundation, version 3.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU Affero General Public License for more details.
12  *
13  * You should have received a copy of the GNU Affero General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  */
16 
17 #ifndef MASTODON_CPP_EASY_RELATIONSHIP_HPP
18 #define MASTODON_CPP_EASY_RELATIONSHIP_HPP
19 
20 #include <string>
21 #include <cstdint>
22 
23 #include "../../mastodon-cpp.hpp"
24 #include "../entity.hpp"
25 
26 using std::string;
27 using std::uint64_t;
28 
29 namespace Mastodon
30 {
31 namespace Easy
32 {
38  class Relationship : public Entity
39  {
40  public:
41  using Entity::Entity;
42 
43  virtual bool valid() const override;
44 
50  bool blocking() const;
51 
57  bool domain_blocking() const;
58 
64  bool endorsed() const;
65 
71  bool followed_by() const;
72 
78  bool following() const;
79 
85  const string id() const;
86 
92  bool muting() const;
93 
99  bool muting_notifications() const;
100 
106  bool requested() const;
107 
113  bool showing_notifications() const;
114 
120  bool showing_reblogs() const;
121  };
122 }
123 }
124 
125 #endif // MASTODON_CPP_EASY_RELATIONSHIP_HPP
const string id() const
Returns the target account ID.
Definition: relationship.cpp:64
Entity()
Constructs an empty Entity object.
Definition: entity.cpp:43
bool showing_notifications() const
Returns true if the user is showing notifications.
Definition: relationship.cpp:84
bool blocking() const
Returns true if the user is blocking the account.
Definition: relationship.cpp:39
bool showing_reblogs() const
Returns true if the user is showing reblogs.
Definition: relationship.cpp:89
bool endorsed() const
Returns true if the account is endorsed by the user.
Definition: relationship.cpp:49
bool followed_by() const
Returns true if the user is being followed by the account.
Definition: relationship.cpp:54
bool muting() const
Returns true if the user is muting the account.
Definition: relationship.cpp:69
bool muting_notifications() const
Returns true if the user is also muting notifications.
Definition: relationship.cpp:74
Collection of things to interface with server software that implements the Mastodon API.
Definition: mastodon-cpp.hpp:47
Base class for all entities.
Definition: entity.hpp:36
bool domain_blocking() const
Returns true if the user is blocking the account's domain.
Definition: relationship.cpp:44
bool following() const
Returns true if the user is being following the account.
Definition: relationship.cpp:59
Class to hold relationships.
Definition: relationship.hpp:38
virtual bool valid() const override
Returns true if the Entity holds valid data.
Definition: relationship.cpp:22
bool requested() const
Returns true if the user has requested to follow the account.
Definition: relationship.cpp:79