diff --git a/saoriview.cpp b/saoriview.cpp index e28889a..af35987 100644 --- a/saoriview.cpp +++ b/saoriview.cpp @@ -157,8 +157,9 @@ saoriaccount->getTimelineData(m_viewname,query); } -const QString SaoriView::headerParser(const QJsonObject json) +const QString SaoriView::headerParser(const QJsonObject json, bool followed, bool following, bool muting, bool blocking) { + qDebug() << m_header["id"].toString().toLongLong() << followed << following << muting << blocking; QString result; result += QString(htmlDiv("accounts_icon", htmlImg("avatar",json["avatar"].toString()))); @@ -463,7 +464,7 @@ if (t.count() == 2) { if (t[1] == m_viewname.split(':')[1]) { m_header = QJsonDocument::fromJson(data).object(); - ui->header->setContent(headerParser(m_header)); + ui->header->setContent(headerParser(m_header,false,false,false,false)); ui->header->show(); } } @@ -547,7 +548,14 @@ void SaoriView::relationship(qlonglong id, QJsonObject data) { - qDebug() << id << data["following"].toBool(); + QStringList t = m_viewname.split(':'); + if (t[1].toInt() == id) { + headerParser(m_header, + data["following"].toBool(), + data["followed_by"].toBool(), + data["muting"].toBool(), + data["blocking"].toBool()); + } } void SaoriView::on_actionReload_triggered() diff --git a/saoriview.h b/saoriview.h index 0b0b0e8..db41529 100644 --- a/saoriview.h +++ b/saoriview.h @@ -61,7 +61,7 @@ protected: void reload(); - const QString headerParser(const QJsonObject json); + const QString headerParser(const QJsonObject json,bool followed,bool following,bool muting,bool blocking); const QString instanceInfoParser(const QString instance); const QString statusParser(const QJsonObject json); const QString accountParser(const QJsonObject json);