summaryrefslogtreecommitdiff
path: root/fetchpostsaction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fetchpostsaction.cpp')
-rw-r--r--fetchpostsaction.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/fetchpostsaction.cpp b/fetchpostsaction.cpp
index 714718c..e38e423 100644
--- a/fetchpostsaction.cpp
+++ b/fetchpostsaction.cpp
@@ -65,9 +65,7 @@ void FetchPostsAction::handleFinishedCall()
// Not fatal, just assume it's the one we requested
topic_id = _topicId;
}
- QString topic_title = map["topic_title"].toString();
- int unread_position = map["position"].toInt();
- qDebug() << "unread_position" << unread_position;
+ QString topic_title = unencodePostContent(map["topic_title"]);
QSqlQuery query(db);
query.prepare("INSERT OR REPLACE INTO posts (topic_id, post_id, post_title, post_content, post_author_id, post_author_name, can_edit, icon_url, post_time, last_update_time) "
@@ -105,10 +103,6 @@ void FetchPostsAction::handleFinishedCall()
_board->notifyTopicPostsChanged(_topicId,
_start, _start + posts.size() - 1);
}
- if (unread_position > 0) {
- // API says this is 1-indexed instead of 0-indexed.
- _board->notifyTopicPostsUnread(_topicId, unread_position - 1);
- }
if (_end == FetchAllPosts && posts.size() == MAX_TOPIC_PAGE_SIZE) {
// Ok, let's prepare to fetch the next block of posts because
// there are probably more of them
@@ -132,7 +126,8 @@ QString FetchPostsAction::unencodePostText(const QVariant &v)
QString FetchPostsAction::unencodePostTitle(const QVariant &v, const QString &topicTitle)
{
QString title = unencodePostText(v);
- if (QString::compare(title, "Re: " + topicTitle, Qt::CaseInsensitive)) {
+ if (QString::compare(title, "Re: " + topicTitle, Qt::CaseInsensitive) == 0) {
+ // Hack to disable the useless "Re: $TOPIC_TITLE" post titles everywhere
return QString();
}
return title;