Fix msg query and sanitize title of msgs better.
This commit is contained in:
parent
8392dffcf7
commit
18491750fb
@ -83,7 +83,7 @@ QString MessagesModelSqlLayer::formatFields() const {
|
|||||||
|
|
||||||
QString MessagesModelSqlLayer::selectStatement() const {
|
QString MessagesModelSqlLayer::selectStatement() const {
|
||||||
return QL1S("SELECT ") + formatFields() +
|
return QL1S("SELECT ") + formatFields() +
|
||||||
QSL(" FROM Messages LEFT JOIN Feeds ON Messages.feed = Feeds.custom_id WHERE ") +
|
QSL(" FROM Messages LEFT JOIN Feeds ON Messages.feed = Feeds.custom_id AND Messages.account_id = Feeds.account_id WHERE ") +
|
||||||
m_filter + orderByClause() + QL1C(';');
|
m_filter + orderByClause() + QL1C(';');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -175,7 +175,11 @@ void Feed::run() {
|
|||||||
// Also, make sure that HTML encoding, encoding of special characters, etc., is fixed.
|
// Also, make sure that HTML encoding, encoding of special characters, etc., is fixed.
|
||||||
msgs[i].m_contents = QUrl::fromPercentEncoding(msgs[i].m_contents.toUtf8());
|
msgs[i].m_contents = QUrl::fromPercentEncoding(msgs[i].m_contents.toUtf8());
|
||||||
msgs[i].m_author = msgs[i].m_author.toUtf8();
|
msgs[i].m_author = msgs[i].m_author.toUtf8();
|
||||||
msgs[i].m_title = QUrl::fromPercentEncoding(msgs[i].m_title.toUtf8());
|
|
||||||
|
// Sanitize title. Remove newlines etc.
|
||||||
|
msgs[i].m_title = QUrl::fromPercentEncoding(msgs[i].m_title.toUtf8())
|
||||||
|
.remove(QRegExp(QSL("[\\n\\r\\t]")))
|
||||||
|
.replace(QRegExp(QSL("[]")), QSL(" "));
|
||||||
}
|
}
|
||||||
|
|
||||||
emit messagesObtained(msgs, error_during_obtaining);
|
emit messagesObtained(msgs, error_during_obtaining);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user