File twitter-Dont-overwrite-contents-of-retweets.patch of Package choqok
From e5e60a1692fe7bed0e3537bef63747ef100d643f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Bri=C3=A8re?= <fbriere@fbriere.net>
Date: Thu, 6 Feb 2020 00:47:34 +0100
Subject: twitter: Don't overwrite original contents of retweets
Retweets are apparently still subject to a 140-character limit, and may
be truncated if the original Tweet was an extended Tweet, or if the
additional "RT @user" prefix pushes them beyond the limit.
If `repeatedPostId` has been set by setRepeatedOfInfo(), then `content`
already contains the full text of the original Tweet, and we don't need
to do anything.
(This doesn't apply to TwitterSearch::readStatusesFromJsonMap(), which
does not call setRepeatedOfInfo() in the first place.)
CCBUG:370260
---
microblogs/twitter/twittermicroblog.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/microblogs/twitter/twittermicroblog.cpp b/microblogs/twitter/twittermicroblog.cpp
index 4052f61..749dabe 100644
--- a/microblogs/twitter/twittermicroblog.cpp
+++ b/microblogs/twitter/twittermicroblog.cpp
@@ -468,7 +468,7 @@ Choqok::Post *TwitterMicroBlog::readPost(Choqok::Account *account, const QVarian
post->replyToUser.userId = var[QLatin1String("in_reply_to_user_id_str")].toString();
// Support for extended tweet_mode
- if (var.contains(QLatin1String("full_text"))) {
+ if (var.contains(QLatin1String("full_text")) && post->repeatedPostId.isEmpty()) {
post->content = var[QLatin1String("full_text")].toString();
}
--
cgit v1.1