From bd441eac0e2f0086139507e188782b0f8bf900e0 Mon Sep 17 00:00:00 2001 From: Morgan McMillian Date: Wed, 5 Feb 2020 22:01:49 -0800 Subject: [PATCH] Refresh post when repost (or remove repost) is performed, issue #57 --- src/Pnut.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Pnut.cpp b/src/Pnut.cpp index 5985a2d..b0029b9 100644 --- a/src/Pnut.cpp +++ b/src/Pnut.cpp @@ -305,6 +305,12 @@ void Pnut::onAuthorizedRequestReady(QByteArray data, int id) req_map.remove(id); getPost(variant.toMap()["data"].toMap()["id"].toString()); } + else if (endpoint.startsWith(":repost")) + { + qDebug() << "Repost successful!"; + req_map.remove(id); + getPost(variant.toMap()["data"].toMap()["id"].toString()); + } else { qDebug() << "GOT SOMETHING NEW!"; @@ -319,6 +325,12 @@ void Pnut::onAuthorizedRequestReady(QByteArray data, int id) qDebug() << "Create post success!"; req_map.remove(id); } + else if (endpoint.startsWith(":repost")) + { + qDebug() << "Repost successful!"; + req_map.remove(id); + getPost(variant.toMap()["data"].toMap()["id"].toString()); + } else { qDebug() << "Good but not sure what";