diff options
author | ConfuSomu | 2023-08-24 18:43:15 -0400 |
---|---|---|
committer | ConfuSomu | 2023-08-24 19:35:58 -0400 |
commit | 9c60bc8ce4a0990c228d2cd746791b88c41532b8 (patch) | |
tree | f6e7d56422f95f8202980a87866f0d798c199f47 /src/net/instance.cpp | |
parent | e625d3fcca7c735ed98570bc1acbcaa840541e61 (diff) | |
download | ActorViewer-9c60bc8ce4a0990c228d2cd746791b88c41532b8.tar ActorViewer-9c60bc8ce4a0990c228d2cd746791b88c41532b8.tar.gz ActorViewer-9c60bc8ce4a0990c228d2cd746791b88c41532b8.zip |
Implement basic Mastodon API support
Implement support for OAuth 2.0 code entry, which is then used to
retrieve a token that is stored in the application's settings.
Authentification allowed the implementation of a basic "get post from
URL" feature mostly made for testing.
Diffstat (limited to 'src/net/instance.cpp')
-rw-r--r-- | src/net/instance.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/net/instance.cpp b/src/net/instance.cpp new file mode 100644 index 0000000..c3af86c --- /dev/null +++ b/src/net/instance.cpp @@ -0,0 +1,24 @@ +#include "instance.h" +#include "mastodon_instance.h" +#include "src/settings_interface.h" + +Instance* Instance::create_instance() { + return create_instance(SettingsInterface::quick_read_setting<AppSettingsTypes::InstanceType>("net/instance/type")); +} + +Instance* Instance::create_instance(AppSettingsTypes::InstanceType type) { + switch (type) { + case AppSettingsTypes::InstanceType::MASTODON: + return new MastodonInstance; + default: + return nullptr; + } +} + +QString Instance::oauth2_step1() { + return ""; +} + +Instance::OAuth2Step2 Instance::oauth2_step2(const QString &auth_code) { + return {false}; +} |