Get 3PID binds on startup

Get binds on startup and update the staus properly after bind/unbinding 3PIDs
This commit is contained in:
James Graham
2024-06-08 08:42:34 +00:00
parent 8e5ccb5461
commit 91109ca845
4 changed files with 98 additions and 2 deletions

View File

@@ -192,6 +192,7 @@ void ThreePIdBindHelper::finalizeNewIdBind()
connect(job, &Quotient::BaseJob::success, this, [this] {
m_bindStatus = Success;
Q_EMIT bindStatusChanged();
m_connection->threePIdModel()->refreshModel();
});
connect(job, &Quotient::BaseJob::failure, this, [this, job]() {
if (job->jsonData()[QLatin1String("errcode")] == QLatin1String("M_SESSION_NOT_VALIDATED")) {
@@ -208,6 +209,7 @@ void ThreePIdBindHelper::unbind3PId(const QString &threePId, const QString &type
{
const auto job = m_connection->callApi<Quotient::Unbind3pidFromAccountJob>(type, threePId);
connect(job, &Quotient::BaseJob::success, this, [this]() {
cancel();
m_connection->threePIdModel()->refreshModel();
});
}