summaryrefslogtreecommitdiff
path: root/transferengine-plugins
diff options
context:
space:
mode:
authorAndrew Branson <andrew.branson@jolla.com>2026-03-22 11:21:35 +0100
committerAndrew Branson <andrew.branson@jolla.com>2026-03-22 19:31:10 +0100
commit86bc18b99cc539949934e22f92f430f040117b21 (patch)
tree260be9618fa4c6685a1f69ad4cd531511704182c /transferengine-plugins
parentd68706916727ccade2f6ceb7ea3faca32d6e3b64 (diff)
Single auth service, and msyncd restart
- Use the microblog service for all auth - Restart msyncd on install if it's running
Diffstat (limited to 'transferengine-plugins')
-rw-r--r--transferengine-plugins/mastodonshareservicestatus.cpp13
-rw-r--r--transferengine-plugins/mastodonshareservicestatus.h1
2 files changed, 11 insertions, 3 deletions
diff --git a/transferengine-plugins/mastodonshareservicestatus.cpp b/transferengine-plugins/mastodonshareservicestatus.cpp
index 3ac05d5..c48be67 100644
--- a/transferengine-plugins/mastodonshareservicestatus.cpp
+++ b/transferengine-plugins/mastodonshareservicestatus.cpp
@@ -27,6 +27,11 @@ MastodonShareServiceStatus::MastodonShareServiceStatus(QObject *parent)
{
}
+QString MastodonShareServiceStatus::authServiceName() const
+{
+ return QStringLiteral("mastodon-microblog");
+}
+
void MastodonShareServiceStatus::signIn(int accountId)
{
Accounts::Account *account = Accounts::Account::fromId(m_accountManager, accountId, this);
@@ -36,9 +41,9 @@ void MastodonShareServiceStatus::signIn(int accountId)
return;
}
- const Accounts::Service service(m_accountManager->service(m_serviceName));
+ const Accounts::Service service(m_accountManager->service(authServiceName()));
if (!service.isValid()) {
- qWarning() << Q_FUNC_INFO << "Invalid auth service" << m_serviceName;
+ qWarning() << Q_FUNC_INFO << "Invalid auth service" << authServiceName();
account->deleteLater();
setAccountDetailsState(accountId, Error);
return;
@@ -123,7 +128,7 @@ void MastodonShareServiceStatus::signOnError(const SignOn::Error &error)
<< error.type() << error.message();
if (accountId > 0 && error.type() == SignOn::Error::UserInteraction) {
- setCredentialsNeedUpdate(accountId, m_serviceName);
+ setCredentialsNeedUpdate(accountId, authServiceName());
}
session->disconnect(this);
@@ -229,7 +234,9 @@ void MastodonShareServiceStatus::queryStatus(QueryStatusMode mode)
if (!m_accountIdToDetailsIdx.contains(id)) {
AccountDetails details;
details.accountId = id;
+ acc->selectService(Accounts::Service());
details.apiHost = MastodonAuthUtils::normalizeApiHost(acc->value(QStringLiteral("api/Host")).toString());
+ acc->selectService(service);
QUrl apiUrl(details.apiHost);
details.providerName = apiUrl.host();
diff --git a/transferengine-plugins/mastodonshareservicestatus.h b/transferengine-plugins/mastodonshareservicestatus.h
index cf2e1f8..42fe171 100644
--- a/transferengine-plugins/mastodonshareservicestatus.h
+++ b/transferengine-plugins/mastodonshareservicestatus.h
@@ -64,6 +64,7 @@ private:
Error
};
+ QString authServiceName() const;
void setAccountDetailsState(int accountId, AccountDetailsState state);
void signIn(int accountId);