summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authortastytea2020-01-10 14:27:00 +0100
committertastytea2020-01-10 14:27:00 +0100
commitf7191d1f3ba841d768f2cc2f7794aab4388732cf (patch)
tree80ae8f736f5317f9110db8e1b9662306e92a41f1 /include
parentc3bb9a20c4c630f65120902e77a8b2fd6c711967 (diff)
downloadmastodonpp-f7191d1f3ba841d768f2cc2f7794aab4388732cf.tar
mastodonpp-f7191d1f3ba841d768f2cc2f7794aab4388732cf.tar.gz
mastodonpp-f7191d1f3ba841d768f2cc2f7794aab4388732cf.zip
Add support for setting the access token.
Diffstat (limited to 'include')
-rw-r--r--include/instance.hpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/instance.hpp b/include/instance.hpp
index 5af177c..1aa76be 100644
--- a/include/instance.hpp
+++ b/include/instance.hpp
@@ -22,6 +22,7 @@
#include <cstdint>
#include <string>
#include <string_view>
+#include <utility>
namespace mastodonpp
{
@@ -29,6 +30,7 @@ namespace mastodonpp
using std::uint64_t;
using std::string;
using std::string_view;
+using std::move;
/*!
* @brief Holds the access data of an instance.
@@ -88,6 +90,19 @@ public:
}
/*!
+ * @brief Set OAuth 2.0 Bearer Access Token.
+ *
+ * Sets also the access token for all Connection%s that are initialized
+ * with this Instance afterwards.
+ *
+ * @since 0.1.0
+ */
+ inline void set_access_token(string access_token)
+ {
+ _access_token = move(access_token);
+ }
+
+ /*!
* @brief Returns the maximum number of characters per post.
*
* @since 0.1.0
@@ -113,6 +128,7 @@ public:
*
* @since 0.1.0
*/
+ [[nodiscard]]
string_view get_proxy() const
{
return _proxy;