diff options
Diffstat (limited to 'src/archive_parser.cpp')
-rw-r--r-- | src/archive_parser.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/archive_parser.cpp b/src/archive_parser.cpp index d3b9197..d9d4cf1 100644 --- a/src/archive_parser.cpp +++ b/src/archive_parser.cpp @@ -129,12 +129,19 @@ void Archive::update_status_list(ViewStatusTypes allowed_types, QListWidget *par if (obj.value("object").isObject()) { QJsonObject activity = obj.value("object").toObject(); + bool has_attachment = false; + if (activity.contains("attachment") and not activity["attachment"].toArray().isEmpty()) + has_attachment = true; + + if (allowed_types.onlyWithAttachment and not has_attachment) + goto next_item; + if (activity.value("content").isString()) { // Strip HTML for display in list, according to https://stackoverflow.com/a/12157835 QTextDocument strip_html; strip_html.setHtml(activity.value("content").toString()); - ListItem *item = new ListItem(strip_html.toPlainText(), status_type, parent, i); + ListItem *item = new ListItem(strip_html.toPlainText(), status_type, has_attachment, parent, i); } } } |