diff --git a/resources/text/CHANGELOG b/resources/text/CHANGELOG index 21802764d..06ac9eecf 100755 --- a/resources/text/CHANGELOG +++ b/resources/text/CHANGELOG @@ -13,6 +13,7 @@ Added: Fixed: +▪ Now title of the RSS/ATOM message is taken into account when deciding message "uniqueness". (bug #171) ▪ MySQL scripts improved. (bug #170) ▪ Fixed little problem with feed list hiding. (bug #163) ▪ Web browser search context menu item now trims the searched string. (bug #168) diff --git a/src/core/parsingfactory.cpp b/src/core/parsingfactory.cpp index ee67a1dd9..b367c39f4 100755 --- a/src/core/parsingfactory.cpp +++ b/src/core/parsingfactory.cpp @@ -242,6 +242,11 @@ QList ParsingFactory::parseAsRSS20(const QString &data) { new_message.m_url = new_message.m_enclosures.first().m_url; } + if (new_message.m_url.isEmpty()) { + // Try to get "href" attribute. + new_message.m_url = message_item.namedItem(QSL("link")).toElement().attribute(QSL("href")); + } + new_message.m_author = message_item.namedItem(QSL("author")).toElement().text(); if (new_message.m_author.isEmpty()) { diff --git a/src/services/abstract/feed.cpp b/src/services/abstract/feed.cpp index bbc28b15a..a1b0e492a 100755 --- a/src/services/abstract/feed.cpp +++ b/src/services/abstract/feed.cpp @@ -192,7 +192,7 @@ int Feed::updateMessages(const QList &messages) { // 3) they have same AUTHOR. query_select_with_url.setForwardOnly(true); query_select_with_url.prepare("SELECT id, date_created, is_read, is_important FROM Messages " - "WHERE feed = :feed AND url = :url AND author = :author AND account_id = :account_id;"); + "WHERE feed = :feed AND title = :title AND url = :url AND author = :author AND account_id = :account_id;"); // When we have custom ID of the message, we can check directly for existence // of that particular message. @@ -242,6 +242,7 @@ int Feed::updateMessages(const QList &messages) { // We need to recognize existing messages according URL & AUTHOR. // NOTE: This concerns messages from standard account. query_select_with_url.bindValue(QSL(":feed"), custom_id); + query_select_with_url.bindValue(QSL(":title"), message.m_title); query_select_with_url.bindValue(QSL(":url"), message.m_url); query_select_with_url.bindValue(QSL(":author"), message.m_author); query_select_with_url.bindValue(QSL(":account_id"), account_id); @@ -293,7 +294,7 @@ int Feed::updateMessages(const QList &messages) { anything_updated = true; - if (query_update.exec()) { + if (query_update.exec() && !message.m_isRead) { updated_messages++; }