| 1 | // For license of this file, seecxx . . $ `<file>/src/librssguard/network-web/apiserver.cpp`/ |
| 2 | // <project-root-folder>/LICENSE.md. |
| 3 | |
| 4 | #include "network-web/apiserver.h"cxx . . $ `<file>/src/librssguard/network-web/apiserver.h`/ |
| 5 | |
| 6 | #include "3rd-party/boolinq/boolinq.h"cxx . . $ `<file>/src/librssguard/3rd-party/boolinq/boolinq.h`/ |
| 7 | #include "core/feedsmodel.h"cxx . . $ `<file>/src/librssguard/core/feedsmodel.h`/ |
| 8 | #include "database/databasefactory.h"cxx . . $ `<file>/src/librssguard/database/databasefactory.h`/ |
| 9 | #include "database/databasequeries.h"cxx . . $ `<file>/src/librssguard/database/databasequeries.h`/ |
| 10 | #include "definitions/definitions.h"cxx . . $ `<file>/src/librssguard/definitions/definitions.h`/ |
| 11 | #include "gui/dialogs/formmain.h"cxx . . $ `<file>/src/librssguard/gui/dialogs/formmain.h`/ |
| 12 | #include "gui/feedmessageviewer.h"cxx . . $ `<file>/src/librssguard/gui/feedmessageviewer.h`/ |
| 13 | #include "gui/messagesview.h"cxx . . $ `<file>/src/librssguard/gui/messagesview.h`/ |
| 14 | #include "miscellaneous/application.h"cxx . . $ `<file>/src/librssguard/miscellaneous/application.h`/ |
| 15 | |
| 16 | #include <QJsonArray> |
| 17 | #include <QMetaEnum> |
| 18 | |
| 19 | ApiServercxx . . $ ApiServer#::ApiServercxx . . $ ApiServer#ApiServer(749de1b6ae65bddd).(QObjectcxx . . $ QObject#* parent) : HttpServercxx . . $ HttpServer#(parent) {} |
| 20 | |
| 21 | void ApiServercxx . . $ ApiServer#::answerClientcxx . . $ ApiServer#answerClient(3437f9300e7c8f28).(QTcpSocketcxx . . $ QTcpSocket#* socket, const HttpRequestcxx . . $ HttpServer#HttpRequest#& request) { |
| 22 | QByteArraycxx . . $ QByteArray# incoming_data = socket->readAllcxx . . $ QIODevice#readAll(b3c286cec66e09f4).(); |
| 23 | QByteArraycxx . . $ QByteArray# reply_messagecxx . . $ QByteArray#QByteArray(ced63f7c635d850d).; |
| 24 | |
| 25 | if (request.m_methodcxx . . $ HttpServer#HttpRequest#m_method. == HttpRequestcxx . . $ HttpServer#HttpRequest#::Methodcxx . . $ HttpServer#HttpRequest#Method#::Optionscxx . . $ HttpServer#HttpRequest#Method#Options.) { |
| 26 | reply_message =cxx . . $ QByteArray#`operator=`(c3d647c78c52d790). processCorsPreflightcxx . . $ ApiServer#processCorsPreflight(a96750bfbcb1fbe9).(); |
| 27 | } |
| 28 | else if (request.m_urlcxx . . $ HttpServer#HttpRequest#m_url..pathcxx . . $ QUrl#path(9d7420bec8bfe6c9).().containscxx . . $ QString#contains(8cce4688c16f48f3).("rssguard"cxx . . $ QString#QString(85c52e162fed56f9).)) { |
| 29 | reply_message =cxx . . $ QByteArray#`operator=`(c3d647c78c52d790). processHtmlPagecxx . . $ ApiServer#processHtmlPage(a96750bfbcb1fbe9).(); |
| 30 | } |
| 31 | else { |
| 32 | QJsonParseErrorcxx . . $ QJsonParseError# json_err; |
| 33 | QByteArraycxx . . $ QByteArray# json_datacxx . . $ QByteArray#QByteArray(ced63f7c635d850d).; |
| 34 | QJsonDocumentcxx . . $ QJsonDocument# incoming_doc = QJsonDocumentcxx . . $ QJsonDocument#::fromJsoncxx . . $ QJsonDocument#fromJson(731a4d2b2d08d93c).(incoming_data, &json_err); |
| 35 | |
| 36 | if (json_err.errorcxx . . $ QJsonParseError#error. != QJsonParseErrorcxx . . $ QJsonParseError#::ParseErrorcxx . . $ QJsonParseError#ParseError#::NoErrorcxx . . $ QJsonParseError#NoError.) { |
| 37 | json_data =cxx . . $ QByteArray#`operator=`(c3d647c78c52d790). |
| 38 | ApiResponsecxx . . $ ApiResponse#ApiResponse(229a4fe696c342a1).(ApiResponsecxx . . $ ApiResponse#::Resultcxx . . $ ApiResponse#Result#::Errorcxx . . $ ApiResponse#Result#Error., ApiRequestcxx . . $ ApiRequest#::Methodcxx . . $ ApiRequest#Method#::Unknowncxx . . $ ApiRequest#Method#Unknown., QJsonValuecxx . . $ QJsonValue#QJsonValue(3520e46b33348bf6).(json_err.errorStringcxx . . $ QJsonParseError#errorString(6ef7b6c27b00b43d).())) |
| 39 | .toJsoncxx . . $ ApiResponse#toJson(290d830f44e0a2d3).() |
| 40 | .toJsoncxx . . $ QJsonDocument#toJson(6b49539da79a45f0).(); |
| 41 | } |
| 42 | else { |
| 43 | ApiRequestcxx . . $ ApiRequest# reqcxx . . $ ApiRequest#ApiRequest(bd3d01ac66d986b4).(incoming_doc); |
| 44 | |
| 45 | try { |
| 46 | ApiResponsecxx . . $ ApiResponse# resp(processRequestcxx . . $ ApiServer#processRequest(7eca650b1ef12a68).(req)); |
| 47 | |
| 48 | json_data =cxx . . $ QByteArray#`operator=`(c3d647c78c52d790). resp.toJsoncxx . . $ ApiResponse#toJson(290d830f44e0a2d3).().toJsoncxx . . $ QJsonDocument#toJson(6b49539da79a45f0).(); |
| 49 | } |
| 50 | catch (const ApplicationExceptioncxx . . $ ApplicationException#& ex) { |
| 51 | ApiResponsecxx . . $ ApiResponse# err_respcxx . . $ ApiResponse#ApiResponse(229a4fe696c342a1).(ApiResponsecxx . . $ ApiResponse#::Resultcxx . . $ ApiResponse#Result#::Errorcxx . . $ ApiResponse#Result#Error., req.m_methodcxx . . $ ApiRequest#m_method., excxx . . $ QJsonValue#QJsonValue(3520e46b33348bf6)..messagecxx . . $ ApplicationException#message(6ef7b6c27b00b43d).()); |
| 52 | |
| 53 | json_data =cxx . . $ QByteArray#`operator=`(c3d647c78c52d790). err_resp.toJsoncxx . . $ ApiResponse#toJson(290d830f44e0a2d3).().toJsoncxx . . $ QJsonDocument#toJson(6b49539da79a45f0).(); |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | reply_message =cxx . . $ QByteArray#`operator=`(c3d647c78c52d790). generateHttpAnswercxx . . $ HttpServer#generateHttpAnswer(bd41d2748839d377).(200, |
| 58 | {cxx . . $ QList#QList(b6da5b9a9f304025).{QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("Access-Control-Allow-" |
| 59 | "Origin"), |
| 60 | QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("*")}, |
| 61 | {QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("Access-Control-Allow-" |
| 62 | "Headers"), |
| 63 | QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("*")}, |
| 64 | {QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("Content-Type"), |
| 65 | QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("application/json; " |
| 66 | "charset=\"utf-8\"")}}, |
| 67 | json_data); |
| 68 | |
| 69 | #if !defined(NDEBUGcxx . . $ `<built-in>:531:9`!) |
| 70 | IOFactory::writeFile("a.out", json_data); |
| 71 | #endif |
| 72 | } |
| 73 | |
| 74 | socket->writecxx . . $ QIODevice#write(4ee2750a0be83987).(reply_message); |
| 75 | socket->disconnectFromHostcxx . . $ QAbstractSocket#disconnectFromHost(49f6e7a06ebc5aa8).(); |
| 76 | } |
| 77 | |
| 78 | QByteArraycxx . . $ QByteArray# ApiServercxx . . $ ApiServer#::processCorsPreflightcxx . . $ ApiServer#processCorsPreflight(a96750bfbcb1fbe9).() const { |
| 79 | return generateHttpAnswercxx . . $ HttpServer#generateHttpAnswer(bd41d2748839d377).(204, |
| 80 | {cxx . . $ QList#QList(b6da5b9a9f304025).{QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("Access-Control-Allow-" |
| 81 | "Origin"), |
| 82 | QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("*")}, |
| 83 | {QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("Access-Control-Allow-" |
| 84 | "Headers"), |
| 85 | QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("*")}, |
| 86 | {QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("Access-Control-Allow-" |
| 87 | "Methods"), |
| 88 | QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("POST, GET, OPTIONS, " |
| 89 | "DELETE")}}); |
| 90 | } |
| 91 | |
| 92 | QByteArraycxx . . $ QByteArray# ApiServercxx . . $ ApiServer#::processHtmlPagecxx . . $ ApiServer#processHtmlPage(a96750bfbcb1fbe9).() const { |
| 93 | QByteArraycxx . . $ QByteArray# pagecxx . . $ QByteArray#QByteArray(ced63f7c635d850d).; |
| 94 | QStringcxx . . $ QString# runtime_page_path = QCoreApplicationcxx . . $ QCoreApplication#::applicationDirPathcxx . . $ QCoreApplication#applicationDirPath(4365c3963150523e).() +cxx . . $ operator+(adfbdceb504720ce). QDircxx . . $ QDir#::separatorcxx . . $ QDir#separator(44eb9225326fcbf5).() +cxx . . $ operator+(adfbdceb504720ce). WEB_UI_FILEcxx . . $ `src/librssguard/definitions/definitions.h:383:9`!; |
| 95 | |
| 96 | if (QFilecxx . . $ QFile#::existscxx . . $ QFile#exists(e1defb592416720d).(runtime_page_path)) { |
| 97 | page =cxx . . $ QByteArray#`operator=`(c3d647c78c52d790). IOFactorycxx . . $ IOFactory#::readFilecxx . . $ IOFactory#readFile(743b31b35d83e992).(runtime_page_path); |
| 98 | } |
| 99 | else { |
| 100 | page =cxx . . $ QByteArray#`operator=`(c3d647c78c52d790). IOFactorycxx . . $ IOFactory#::readFilecxx . . $ IOFactory#readFile(743b31b35d83e992).(WEB_UI_FOLDERcxx . . $ `src/librssguard/definitions/definitions.h:382:9`! +cxx . . $ operator+(adfbdceb504720ce). QL1Ccxx . . $ `src/librssguard/definitions/definitions.h:455:9`!('/') +cxx . . $ operator+(adfbdceb504720ce). WEB_UI_FILEcxx . . $ `src/librssguard/definitions/definitions.h:383:9`!); |
| 101 | } |
| 102 | |
| 103 | QByteArraycxx . . $ QByteArray# data = generateHttpAnswercxx . . $ HttpServer#generateHttpAnswer(bd41d2748839d377).(200, |
| 104 | {cxx . . $ QList#QList(b6da5b9a9f304025).{QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("Access-Control-Allow-" |
| 105 | "Origin"), |
| 106 | QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("*")}, |
| 107 | {QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("Access-Control-Allow-" |
| 108 | "Headers"), |
| 109 | QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("*")}, |
| 110 | {QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("Access-Control-Allow-" |
| 111 | "Methods"), |
| 112 | QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("POST, GET, OPTIONS, " |
| 113 | "DELETE")}, |
| 114 | {QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("Content-Type"), |
| 115 | QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("text/html; " |
| 116 | "charset=\"utf-8\"")}}, |
| 117 | page); |
| 118 | |
| 119 | return datacxx . . $ QByteArray#QByteArray(9f1b912973d89fea).; |
| 120 | } |
| 121 | |
| 122 | ApiResponsecxx . . $ ApiResponse# ApiServercxx . . $ ApiServer#::processRequestcxx . . $ ApiServer#processRequest(7eca650b1ef12a68).(const ApiRequestcxx . . $ ApiRequest#& req) const { |
| 123 | switch (req.m_methodcxx . . $ ApiRequest#m_method.) { |
| 124 | case ApiRequestcxx . . $ ApiRequest#::Methodcxx . . $ ApiRequest#Method#::AppVersioncxx . . $ ApiRequest#Method#AppVersion.: |
| 125 | return processAppVersioncxx . . $ ApiServer#processAppVersion(5b048b6c9cfa1a3b).(); |
| 126 | |
| 127 | case ApiRequestcxx . . $ ApiRequest#::Methodcxx . . $ ApiRequest#Method#::ArticlesFromFeedcxx . . $ ApiRequest#Method#ArticlesFromFeed.: |
| 128 | return processArticlesFromFeedcxx . . $ ApiServer#processArticlesFromFeed(53114321d01ec876).(req.m_parameterscxx . . $ ApiRequest#m_parameters.); |
| 129 | |
| 130 | case ApiRequestcxx . . $ ApiRequest#::Methodcxx . . $ ApiRequest#Method#::MarkArticlescxx . . $ ApiRequest#Method#MarkArticles.: |
| 131 | return processMarkArticlescxx . . $ ApiServer#processMarkArticles(53114321d01ec876).(req.m_parameterscxx . . $ ApiRequest#m_parameters.); |
| 132 | |
| 133 | case ApiRequestcxx . . $ ApiRequest#::Methodcxx . . $ ApiRequest#Method#::Unknowncxx . . $ ApiRequest#Method#Unknown.: |
| 134 | default: |
| 135 | return processUnknowncxx . . $ ApiServer#processUnknown(5b048b6c9cfa1a3b).(); |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | ApiResponsecxx . . $ ApiResponse# ApiServercxx . . $ ApiServer#::processAppVersioncxx . . $ ApiServer#processAppVersion(5b048b6c9cfa1a3b).() const { |
| 140 | return ApiResponsecxx . . $ ApiResponse#ApiResponse(229a4fe696c342a1).(ApiResponsecxx . . $ ApiResponse#::Resultcxx . . $ ApiResponse#Result#::Successcxx . . $ ApiResponse#Result#Success., ApiRequestcxx . . $ ApiRequest#::Methodcxx . . $ ApiRequest#Method#::AppVersioncxx . . $ ApiRequest#Method#AppVersion., QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(APP_VERSIONcxx . . $ `<built-in>:496:9`!)); |
| 141 | } |
| 142 | |
| 143 | ApiResponsecxx . . $ ApiResponse# ApiServercxx . . $ ApiServer#::processMarkArticlescxx . . $ ApiServer#processMarkArticles(53114321d01ec876).(const QJsonValuecxx . . $ QJsonValue#& req) const { |
| 144 | QJsonObjectcxx . . $ QJsonObject# data = req.toObjectcxx . . $ QJsonValue#toObject(ac8af9874357714b).(); |
| 145 | |
| 146 | bool mark_read = data.valuecxx . . $ QJsonObject#value(23911ba692ce408c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("mark_read")).toBoolcxx . . $ QJsonValue#toBool(962fae8be55e1d9).(); |
| 147 | bool mark_unread = data.valuecxx . . $ QJsonObject#value(23911ba692ce408c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("mark_unread")).toBoolcxx . . $ QJsonValue#toBool(962fae8be55e1d9).(); |
| 148 | bool mark_starred = data.valuecxx . . $ QJsonObject#value(23911ba692ce408c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("mark_starred")).toBoolcxx . . $ QJsonValue#toBool(962fae8be55e1d9).(); |
| 149 | bool mark_unstarred = data.valuecxx . . $ QJsonObject#value(23911ba692ce408c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("mark_unstarred")).toBoolcxx . . $ QJsonValue#toBool(962fae8be55e1d9).(); |
| 150 | |
| 151 | QMapcxx . . $ QMap#<int, QStringListcxx . . $ QStringList#> articles_per_accountscxx . . $ QMap#QMap(49f6e7a06ebc5aa8).; |
| 152 | |
| 153 | for (const QJsonValuecxx . . $ QJsonValue#& article_val : data.valuecxx . . $ QJsonObject#value(23911ba692ce408c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("articles")).toArraycxx . . $ QJsonValue#toArray(98974f179f8308bf).()) { |
| 154 | QJsonObjectcxx . . $ QJsonObject# article_obj = article_val.toObjectcxx . . $ QJsonValue#toObject(ac8af9874357714b).(); |
| 155 | |
| 156 | articles_per_accounts[cxx . . $ QMap#`operator[]`(bbd415b616967878).article_obj.valuecxx . . $ QJsonObject#value(23911ba692ce408c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("account")).toIntcxx . . $ QJsonValue#toInt(7ccb52b1bfe01045).()] |
| 157 | .appendcxx . . $ QList#append(1262c8661f7a27a7).(article_obj.valuecxx . . $ QJsonObject#value(23911ba692ce408c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("article_custom_id")).toStringcxx . . $ QJsonValue#toString(6ef7b6c27b00b43d).()); |
| 158 | } |
| 159 | |
| 160 | QMapIteratorcxx . . $ QMapIterator#<int, QStringListcxx . . $ QStringList#> articles_per_accounts_itercxx . . $ QMapIterator#QMapIterator(1d85e448f11cafa).(articles_per_accounts); |
| 161 | QSqlDatabasecxx . . $ QSqlDatabase# database = qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->databasecxx . . $ Application#database(4a253a6ca99872d8).()->drivercxx . . $ DatabaseFactory#driver(5299be7c9afd522d).()->connectioncxx . . $ DatabaseDriver#connection(32d6d64cc6e35a97).(metaObjectcxx . . $ QString#QString(85c52e162fed56f9).()->classNamecxx . . $ QMetaObject#className(a9f41ea0e82d88cf).()); |
| 162 | |
| 163 | RootItemcxx . . $ RootItem#::ReadStatuscxx . . $ RootItem#ReadStatus# target_read = mark_read ? RootItemcxx . . $ RootItem#::ReadStatuscxx . . $ RootItem#ReadStatus#::Readcxx . . $ RootItem#ReadStatus#Read. : RootItemcxx . . $ RootItem#::ReadStatuscxx . . $ RootItem#ReadStatus#::Unreadcxx . . $ RootItem#ReadStatus#Unread.; |
| 164 | |
| 165 | if (!mark_read && !mark_unread) { |
| 166 | target_read = RootItemcxx . . $ RootItem#::ReadStatuscxx . . $ RootItem#ReadStatus#::Unknowncxx . . $ RootItem#ReadStatus#Unknown.; |
| 167 | } |
| 168 | |
| 169 | RootItemcxx . . $ RootItem#::Importancecxx . . $ RootItem#Importance# target_important = |
| 170 | mark_starred ? RootItemcxx . . $ RootItem#::Importancecxx . . $ RootItem#Importance#::Importantcxx . . $ RootItem#Importance#Important. : RootItemcxx . . $ RootItem#::Importancecxx . . $ RootItem#Importance#::NotImportantcxx . . $ RootItem#Importance#NotImportant.; |
| 171 | |
| 172 | if (!mark_starred && !mark_unstarred) { |
| 173 | target_important = RootItemcxx . . $ RootItem#::Importancecxx . . $ RootItem#Importance#::Unknowncxx . . $ RootItem#Importance#Unknown.; |
| 174 | } |
| 175 | |
| 176 | QListcxx . . $ QList#<ServiceRootcxx . . $ ServiceRoot#*> accts = qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->feedReadercxx . . $ Application#feedReader(db5fdbb995cddeff).()->feedsModelcxx . . $ FeedReader#feedsModel(9c5c1ec683fc5474).()->serviceRootscxx . . $ FeedsModel#serviceRoots(af687dfb2ba79ab4).(); |
| 177 | auto linq_accts = boolinqcxx . . $ boolinq/::fromcxx . . $ boolinq/from(1a44d082b2747720).(accts); |
| 178 | |
| 179 | while (articles_per_accounts_iter.hasNextcxx . . $ QMapIterator#hasNext(50ce9a9e25b4a850).()) { |
| 180 | auto nxt = articles_per_accounts_iter.nextcxx . . $ QMapIterator#next(5c754f5fbc3bb3d6).(); |
| 181 | int account_id = nxt.keycxx . . $ QMap#const_iterator#key(ea465e50d690edfe).(); |
| 182 | QStringListcxx . . $ QStringList# custom_ids = nxt.valuecxx . . $ QMap#const_iterator#value(bdbd05d619d62250).(); |
| 183 | ServiceRootcxx . . $ ServiceRoot#* acc = linq_accts.firstOrDefaultcxx . . $ boolinq/Linq#firstOrDefault(72be2761f3eff290).([cxx . . $ std/function#function(bdc3712e480e4d04).=](ServiceRootcxx . . $ ServiceRoot#* acc) { |
| 184 | return acc->accountIdcxx . . $ ServiceRoot#accountId(455f465bc33b4cdf).() == account_id; |
| 185 | }); |
| 186 | |
| 187 | if (acc == nullptr) { |
| 188 | throw ApplicationExceptioncxx . . $ ApplicationException#(trcxx . . $ HttpServer#tr(75d9f1c324b4579d).("account with ID %1 not found").argcxx . . $ QString#arg(ed67e9a87de2cd4e).(account_id)); |
| 189 | } |
| 190 | |
| 191 | DatabaseQueriescxx . . $ DatabaseQueries#::markMessagesReadUnreadImportantcxx . . $ DatabaseQueries#markMessagesReadUnreadImportant(29e762a1ad0fa08d).(database, account_id, custom_ids, target_read, target_important); |
| 192 | } |
| 193 | |
| 194 | // All updates are done, recalculate. |
| 195 | qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->feedReadercxx . . $ Application#feedReader(db5fdbb995cddeff).()->feedsModelcxx . . $ FeedReader#feedsModel(9c5c1ec683fc5474).()->reloadCountsOfWholeModelcxx . . $ FeedsModel#reloadCountsOfWholeModel(49f6e7a06ebc5aa8).(); |
| 196 | qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->mainFormcxx . . $ Application#mainForm(da73b49c3e1670d9).()->tabWidgetcxx . . $ FormMain#tabWidget(331dafdc3f7547ba).()->feedMessageViewercxx . . $ TabWidget#feedMessageViewer(f908a1dc9ca40ab9).()->messagesViewcxx . . $ FeedMessageViewer#messagesView(fd6f766f8adc6afe).()->reloadSelectionscxx . . $ MessagesView#reloadSelections(49f6e7a06ebc5aa8).(); |
| 197 | |
| 198 | ApiResponsecxx . . $ ApiResponse# respcxx . . $ ApiResponse#ApiResponse(229a4fe696c342a1).(ApiResponsecxx . . $ ApiResponse#::Resultcxx . . $ ApiResponse#Result#::Successcxx . . $ ApiResponse#Result#Success., ApiRequestcxx . . $ ApiRequest#::Methodcxx . . $ ApiRequest#Method#::MarkArticlescxx . . $ ApiRequest#Method#MarkArticles.); |
| 199 | return resp; |
| 200 | } |
| 201 | |
| 202 | ApiResponsecxx . . $ ApiResponse# ApiServercxx . . $ ApiServer#::processArticlesFromFeedcxx . . $ ApiServer#processArticlesFromFeed(53114321d01ec876).(const QJsonValuecxx . . $ QJsonValue#& req) const { |
| 203 | QJsonObjectcxx . . $ QJsonObject# data = req.toObjectcxx . . $ QJsonValue#toObject(ac8af9874357714b).(); |
| 204 | |
| 205 | QStringcxx . . $ QString# feed_id = data.valuecxx . . $ QJsonObject#value(23911ba692ce408c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("feed")).toStringcxx . . $ QJsonValue#toString(6ef7b6c27b00b43d).(); |
| 206 | qint64cxx . . $ qint64# start_after_article_date = qint64cxx . . $ qint64#(data.valuecxx . . $ QJsonObject#value(23911ba692ce408c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("start_after_article_date")).toDoublecxx . . $ QJsonValue#toDouble(7e3a3c6b59947c6d).()); |
| 207 | int account_id = data.valuecxx . . $ QJsonObject#value(23911ba692ce408c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("account")).toIntcxx . . $ QJsonValue#toInt(7ccb52b1bfe01045).(); |
| 208 | bool newest_first = data.valuecxx . . $ QJsonObject#value(23911ba692ce408c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("newest_first")).toBoolcxx . . $ QJsonValue#toBool(962fae8be55e1d9).(); |
| 209 | bool unread_only = data.valuecxx . . $ QJsonObject#value(23911ba692ce408c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("unread_only")).toBoolcxx . . $ QJsonValue#toBool(962fae8be55e1d9).(); |
| 210 | bool starred_only = data.valuecxx . . $ QJsonObject#value(23911ba692ce408c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("starred_only")).toBoolcxx . . $ QJsonValue#toBool(962fae8be55e1d9).(); |
| 211 | int row_offset = data.valuecxx . . $ QJsonObject#value(23911ba692ce408c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("row_offset")).toIntcxx . . $ QJsonValue#toInt(7ccb52b1bfe01045).(); |
| 212 | int row_limit = data.valuecxx . . $ QJsonObject#value(23911ba692ce408c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("row_limit")).toIntcxx . . $ QJsonValue#toInt(7ccb52b1bfe01045).(100000); |
| 213 | |
| 214 | // NOTE: Fixup arguments. |
| 215 | if (feed_id ==cxx . . $ `operator==`(5bc2975d2d751687). QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("0")) { |
| 216 | feed_id =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#QString(ced63f7c635d850d).(); |
| 217 | } |
| 218 | |
| 219 | QSqlDatabasecxx . . $ QSqlDatabase# database = qAppcxx . . $ `src/librssguard/miscellaneous/application.h:30:9`!->databasecxx . . $ Application#database(4a253a6ca99872d8).()->drivercxx . . $ DatabaseFactory#driver(5299be7c9afd522d).()->connectioncxx . . $ DatabaseDriver#connection(32d6d64cc6e35a97).(metaObjectcxx . . $ QString#QString(85c52e162fed56f9).()->classNamecxx . . $ QMetaObject#className(a9f41ea0e82d88cf).()); |
| 220 | QListcxx . . $ QList#<Messagecxx . . $ Message#> msgs = DatabaseQueriescxx . . $ DatabaseQueries#::getArticlesSlicecxx . . $ DatabaseQueries#getArticlesSlice(b19a248cd3d41b64).(database, |
| 221 | feed_id, |
| 222 | account_id, |
| 223 | newest_first, |
| 224 | unread_only, |
| 225 | starred_only, |
| 226 | start_after_article_date, |
| 227 | row_offset, |
| 228 | row_limit); |
| 229 | QJsonArraycxx . . $ QJsonArray# msgs_json_arraycxx . . $ QJsonArray#QJsonArray(49f6e7a06ebc5aa8).; |
| 230 | |
| 231 | for (const Messagecxx . . $ Message#& msg : msgs) { |
| 232 | msgs_json_array.appendcxx . . $ QJsonArray#append(df7ecffd47ab3d85).(msgcxx . . $ QJsonValue#QJsonValue(6e8cef2e25ca0153)..toJsoncxx . . $ Message#toJson(ac8af9874357714b).()); |
| 233 | } |
| 234 | |
| 235 | ApiResponsecxx . . $ ApiResponse# respcxx . . $ ApiResponse#ApiResponse(229a4fe696c342a1).(ApiResponsecxx . . $ ApiResponse#::Resultcxx . . $ ApiResponse#Result#::Successcxx . . $ ApiResponse#Result#Success., ApiRequestcxx . . $ ApiRequest#::Methodcxx . . $ ApiRequest#Method#::ArticlesFromFeedcxx . . $ ApiRequest#Method#ArticlesFromFeed., msgs_json_arraycxx . . $ QJsonValue#QJsonValue(20c42333f6e567d0).); |
| 236 | |
| 237 | return resp; |
| 238 | } |
| 239 | |
| 240 | ApiResponsecxx . . $ ApiResponse# ApiServercxx . . $ ApiServer#::processUnknowncxx . . $ ApiServer#processUnknown(5b048b6c9cfa1a3b).() const { |
| 241 | return ApiResponsecxx . . $ ApiResponse#ApiResponse(229a4fe696c342a1).(ApiResponsecxx . . $ ApiResponse#::Resultcxx . . $ ApiResponse#Result#::Errorcxx . . $ ApiResponse#Result#Error., |
| 242 | ApiRequestcxx . . $ ApiRequest#::Methodcxx . . $ ApiRequest#Method#::Unknowncxx . . $ ApiRequest#Method#Unknown., |
| 243 | QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("unknown " |
| 244 | "method")); |
| 245 | } |
| 246 | |
| 247 | ApiResponsecxx . . $ ApiResponse#::ApiResponsecxx . . $ ApiResponse#ApiResponse(229a4fe696c342a1).(Resultcxx . . $ ApiResponse#Result# result, ApiRequestcxx . . $ ApiRequest#::Methodcxx . . $ ApiRequest#Method# method, const QJsonValuecxx . . $ QJsonValue#& response) |
| 248 | : m_resultcxx . . $ ApiResponse#m_result.(result), m_methodcxx . . $ ApiResponse#m_method.(method), m_responsecxx . . $ ApiResponse#m_response.(response) {} |
| 249 | |
| 250 | QJsonDocumentcxx . . $ QJsonDocument# ApiResponsecxx . . $ ApiResponse#::toJsoncxx . . $ ApiResponse#toJson(290d830f44e0a2d3).() const { |
| 251 | QJsonObjectcxx . . $ QJsonObject# objcxx . . $ QJsonObject#QJsonObject(49f6e7a06ebc5aa8).; |
| 252 | |
| 253 | static QMetaEnumcxx . . $ QMetaEnum# enumer_method = QMetaEnumcxx . . $ QMetaEnum#::fromTypecxx . . $ QMetaEnum#fromType(4ccfc8a907eb718d).<ApiRequestcxx . . $ ApiRequest#::Methodcxx . . $ ApiRequest#Method#>(); |
| 254 | static QMetaEnumcxx . . $ QMetaEnum# enumer_result = QMetaEnumcxx . . $ QMetaEnum#::fromTypecxx . . $ QMetaEnum#fromType(4ccfc8a907eb718d).<ApiResponsecxx . . $ ApiResponse#::Resultcxx . . $ ApiResponse#Result#>(); |
| 255 | |
| 256 | obj.insertcxx . . $ QJsonObject#insert(5dcbc06600439223).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("method"), enumer_methodcxx . . $ QJsonValue#QJsonValue(85c52e162fed56f9)..valueToKeycxx . . $ QMetaEnum#valueToKey(5afb982068bc4a78).(int(m_methodcxx . . $ ApiResponse#m_method.))); |
| 257 | obj.insertcxx . . $ QJsonObject#insert(5dcbc06600439223).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("result"), enumer_resultcxx . . $ QJsonValue#QJsonValue(85c52e162fed56f9)..valueToKeycxx . . $ QMetaEnum#valueToKey(5afb982068bc4a78).(int(m_resultcxx . . $ ApiResponse#m_result.))); |
| 258 | |
| 259 | if (!m_responsecxx . . $ ApiResponse#m_response..isNullcxx . . $ QJsonValue#isNull(50ce9a9e25b4a850).() && !m_responsecxx . . $ ApiResponse#m_response..isUndefinedcxx . . $ QJsonValue#isUndefined(50ce9a9e25b4a850).()) { |
| 260 | obj.insertcxx . . $ QJsonObject#insert(5dcbc06600439223).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("data"), m_responsecxx . . $ ApiResponse#m_response.); |
| 261 | } |
| 262 | |
| 263 | return QJsonDocumentcxx . . $ QJsonDocument#QJsonDocument(6b379e5d051a9fe4).(obj); |
| 264 | } |
| 265 | |
| 266 | ApiRequestcxx . . $ ApiRequest#::ApiRequestcxx . . $ ApiRequest#ApiRequest(bd3d01ac66d986b4).(const QJsonDocumentcxx . . $ QJsonDocument#& data) |
| 267 | : m_methodcxx . . $ ApiRequest#m_method.(), m_parameterscxx . . $ ApiRequest#m_parameters.(data.objectcxx . . $ QJsonDocument#object(ac8af9874357714b).().valuecxx . . $ QJsonObject#value(23911ba692ce408c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("dat" |
| 268 | "a"))) { |
| 269 | static QMetaEnumcxx . . $ QMetaEnum# enumer = QMetaEnumcxx . . $ QMetaEnum#::fromTypecxx . . $ QMetaEnum#fromType(4ccfc8a907eb718d).<ApiRequestcxx . . $ ApiRequest#::Methodcxx . . $ ApiRequest#Method#>(); |
| 270 | |
| 271 | QByteArraycxx . . $ QByteArray# method_name = data.objectcxx . . $ QJsonDocument#object(ac8af9874357714b).().valuecxx . . $ QJsonObject#value(23911ba692ce408c).(QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!("method")).toStringcxx . . $ QJsonValue#toString(6ef7b6c27b00b43d).().toLocal8Bitcxx . . $ QString#toLocal8Bit(7c2073558a834e49).(); |
| 272 | |
| 273 | m_methodcxx . . $ ApiRequest#m_method. = Methodcxx . . $ ApiRequest#Method#(enumer.keysToValuecxx . . $ QMetaEnum#keysToValue(f747eaf02f82dd19).(method_name.constDatacxx . . $ QByteArray#constData(ba32b354807b2b81).())); |
| 274 | } |