Summary: | No support for tweets with >140 characters | ||
---|---|---|---|
Product: | [Applications] choqok | Reporter: | Antonio Rojas <arojas> |
Component: | Assignee: | Mehrdad Momeny <mehrdad.momeny> | |
Status: | RESOLVED FIXED | ||
Severity: | major | CC: | bugs, eliseu1983, fbriere, jsardid, kdedevel, lee295012, mario, Mathias.Homann, nazir.cz, patrice.grundmann, scarpino |
Priority: | NOR | ||
Version: | Git | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | https://commits.kde.org/choqok/0ecc05c1d261977eb3131c5d05cd1d414962c7f7 | Version Fixed In: | 1.7 |
Sentry Crash Report: | |||
Attachments: |
Screenshot
Possible patch Patch for v1.4 [PATCH] Don't overwrite original contents of retweets [PATCH] Don't overwrite original contents of retweets [v2] |
Description
Antonio Rojas
2016-10-07 20:08:26 UTC
Hi Antonio, I'm sorry but I don't get what you mean here. However, note that links longer than `short_url_length` doesn't influence the maximum length of the tweet (see https://dev.twitter.com/overview/t.co). Created attachment 101496 [details] Screenshot Links and mentions now don't count at all towards the 140 limit, see https://blog.twitter.com/2016/doing-more-with-140-characters For instance, this tweet: https://twitter.com/i/web/status/784121721301438465 is ellided in choqok, see attached screenshot I can confirm, this is about how the client deals with the new extended Tweets, see https://dev.twitter.com/overview/api/upcoming-changes-to-tweets for informations. Twitter now has officially increased the length allowed for tweets to 280 characters. Please upgrade this in choqok. Raising severity based on comment #4. Created attachment 108752 [details]
Possible patch
I'm using KDE4 and Choqok 1.4 at the moment so I can't test this patch against master (I can't even test if it compiles!), but the corresponding patch against 1.4 seems to work OK based on my limited testing.
Can someone who is using Choqok master give it a try?
Created attachment 108768 [details]
Patch for v1.4
Looks like I was a little premature with that last patch :) I've attached my patch against v1.4 in the hopes that it will give some inspiration to people working on master.
Why it works: Choqok doesn't actually do the truncation itself; rather, by default, twitter will actually do it *on the server side*+ - this patch simply adds the "tweet_mode=extended" query, and reads the "full_text" of the returned JSON instead of the "text".
+ I spent about half an hour yesterday trying to figure out just *where* Choqok was performing the truncation - kicked myself when I figure out what was actually going on! XD
(In reply to Simon St James from comment #7) > Created attachment 108768 [details] > Patch for v1.4 > > Looks like I was a little premature with that last patch :) I've attached my > patch against v1.4 in the hopes that it will give some inspiration to people > working on master. > > Why it works: Choqok doesn't actually do the truncation itself; rather, by > default, twitter will actually do it *on the server side*+ - this patch > simply adds the "tweet_mode=extended" query, and reads the "full_text" of > the returned JSON instead of the "text". > > + I spent about half an hour yesterday trying to figure out just *where* > Choqok was performing the truncation - kicked myself when I figure out what > was actually going on! XD Does this work for posting as well? *** Bug 386960 has been marked as a duplicate of this bug. *** > Does this work for posting as well?
Posting is just fine even without the patch, I tested it in Choqok 1.6. The only issue is the countdown that starts at 140.
> Why it works: Choqok doesn't actually do the truncation itself; rather, by default, twitter will actually do it *on the server side*+ - this patch simply adds the "tweet_mode=extended" query, and reads the "full_text" of the returned JSON instead of the "text".
IMO, this patch will increase the functionality a lot. Even before the change to 280 ch, I frequently had to open the browser to read complete messages that were cut.
It is great that you realize how to do it properly.
Thanks!
Git commit 0ecc05c1d261977eb3131c5d05cd1d414962c7f7 by Andrea Scarpino. Committed on 18/11/2017 at 16:33. Pushed by scarpino into branch 'master'. [twitter] support for extended tweet FIXED-IN: 1.7 M +106 -0 microblogs/twitter/twittermicroblog.cpp M +4 -0 microblogs/twitter/twittermicroblog.h M +9 -0 microblogs/twitter/twittersearch.cpp https://commits.kde.org/choqok/0ecc05c1d261977eb3131c5d05cd1d414962c7f7 (In reply to Simon St James from comment #7) > Created attachment 108768 [details] > Patch for v1.4 > Why it works: Choqok doesn't actually do the truncation itself; rather, by > default, twitter will actually do it *on the server side*+ - this patch > simply adds the "tweet_mode=extended" query, and reads the "full_text" of > the returned JSON instead of the "text". Thank you Simon! I rebased your work and pushed to master. Mainly because twitterapi is used by Twitter and GNU Social code, while this is only a Twitter thing. > I rebased your work and pushed to master.
Hi Andrea,
Could you please release version 1.7 so final users can benefit from this enhancement?
Many thanks in advance!
I compiled choqok with the fix and I still see something weird going on: Look for example at this message: https://twitter.com/i/web/status/931891495212404738 The text reads: Network Theory: It's used by scientists around the world studying the human genome, the efficiencies of green power grids, the economics of world trade and a hundred other applications. That is 186 characters in total (and an image) This message gets cut in choqok to: Network Theory: It's used by scientists around the world studying the human genome, the efficiencies of green power… https://t.co/KFowfJeOuN Can this be fixed somehow? (In reply to avlas from comment #15) > I compiled choqok with the fix and I still see something weird going on: > > Look for example at this message: > > https://twitter.com/i/web/status/931891495212404738 > > The text reads: Network Theory: It's used by scientists around the world > studying the human genome, the efficiencies of green power grids, the > economics of world trade and a hundred other applications. > > That is 186 characters in total (and an image) > > This message gets cut in choqok to: Network Theory: It's used by scientists > around the world studying the human genome, the efficiencies of green power… > https://t.co/KFowfJeOuN > > Can this be fixed somehow? And actually the image does not appear embedded in choqok, I would say this is because the message got cut, but not sure... I built a rpm from git master, and when I tried to send a tweet to twitter I got an error message saying "Could not authorize you"... The actual error message is: "Creating the new post failed, with error: Could not authenticate you." ...restarting my kde session dit it. I think the issue below actually relates to retweets (I didn't get the original tweet in choqok but a retweet of it). So I'm going to open a new bug specifically for retweets. (In reply to avlas from comment #15) > I compiled choqok with the fix and I still see something weird going on: > > Look for example at this message: > > https://twitter.com/i/web/status/931891495212404738 > > The text reads: Network Theory: It's used by scientists around the world > studying the human genome, the efficiencies of green power grids, the > economics of world trade and a hundred other applications. > > That is 186 characters in total (and an image) > > This message gets cut in choqok to: Network Theory: It's used by scientists > around the world studying the human genome, the efficiencies of green power… > https://t.co/KFowfJeOuN > > Can this be fixed somehow? (In reply to Mathias Homann from comment #19) > ...restarting my kde session dit it. actually, I have the same error on and off. (In reply to Mathias Homann from comment #21) > (In reply to Mathias Homann from comment #19) > > ...restarting my kde session dit it. > > actually, I have the same error on and off. Suffering the same thing. I cannot send any tweet from choqok :/ (Re-)validating the twitter account does not work in master version of choqok (nothing happens, that is the browser does not open any window/tab in which twitter informs about the oauth number to introduce back in choqok, neither choqok is waiting for anything). All this works just fine downgrading to choqok version 1.6. (In reply to avlas from comment #23) > (Re-)validating the twitter account does not work in master version of > choqok (nothing happens, that is the browser does not open any window/tab in > which twitter informs about the oauth number to introduce back in choqok, > neither choqok is waiting for anything). > > All this works just fine downgrading to choqok version 1.6. I assumed, but not sure, that the issue came from last changes related to this issue. If you believe this is an entirely different thing, I will open a new bug... (In reply to avlas from comment #24) > I assumed, but not sure, that the issue came from last changes related to > this issue. If you believe this is an entirely different thing, I will open > a new bug... It seems there are two different issues here: - the problem of not being able to revalidate an account (didn't try to validate an account from scratch) started in the transition from qoauth to qtnetworkauth (commit c43125e48387a8d3a914c97cd8d8765c5c07fa89) - the problem of not being able to tweet even if the account is validated appeared in commits related to this bug, after commit 573e5a7411307644bb3f1882e0bb2a9aedd849f9 This patch doesn't fix the problem for me, it's still reproducible with git master. Moreover, this causes all retweets to have the unnecessary text "RT @account" preprended. Andrea, could you have a look at the recent comments? No response, changing status. (In reply to Antonio Rojas from comment #26) > This patch doesn't fix the problem for me, it's still reproducible with git > master. Moreover, this causes all retweets to have the unnecessary text "RT > @account" preprended. I'm sorry for the late reply. I confirm your words. However, we don't prepend that text, so I suspect this is the original Twitter behaviour and I broke the Choqok code that was removing that text maybe? I'll investigate. (In reply to Andrea Scarpino from comment #29) > However, we don't prepend that text, so I suspect this > is the original Twitter behaviour and I broke the Choqok code that was > removing that text maybe? Close. Your patch overwrites the (already decoded) contents of the original Tweet with that of the retweet, which contains the "RT @user" prefix (and is apparently still limited to 140 characters). I'll attach a simple fix. Created attachment 112170 [details]
[PATCH] Don't overwrite original contents of retweets
Created attachment 112171 [details]
[PATCH] Don't overwrite original contents of retweets [v2]
Sorry, the previous patch was taken from a modified 1.6 branch, and while it applies cleanly to master, the offset line numbers are enough to throw git off. Here's a revised version.
(In reply to Frédéric Brière from comment #32) > Sorry, the previous patch was taken from a modified 1.6 branch, and while it > applies cleanly to master, the offset line numbers are enough to throw git > off. Here's a revised version. Great, but please use phabricator instead. Frédéric, any success with https://phabricator.kde.org/differential/diff/create/ ? Hello, When will come out Choqok version 1.7 with the bug fix? Thanks for the job. (In reply to Patrice Grundmann from comment #35) > Hello, > > When will come out Choqok version 1.7 with the bug fix? > > Thanks for the job. I don't think there is any proper fix yet. Version 1.6 works better for me than master. As far as I can see, choqok is mostly unmaintained at this point. (In reply to avlas from comment #25) > (In reply to avlas from comment #24) > > > I assumed, but not sure, that the issue came from last changes related to > > this issue. If you believe this is an entirely different thing, I will open > > a new bug... > > It seems there are two different issues here: > > - the problem of not being able to revalidate an account (didn't try to > validate an account from scratch) started in the transition from qoauth to > qtnetworkauth (commit c43125e48387a8d3a914c97cd8d8765c5c07fa89) > > - the problem of not being able to tweet even if the account is validated > appeared in commits related to this bug, after commit > 573e5a7411307644bb3f1882e0bb2a9aedd849f9 I tested master again, and to be fair, the above issues seem to have been indeed fixed. My apologies for the previous comment. Is there anything retaining this issue to be set to Fixed Status? One issue I can see in master version, I recall it now I saw it before too, is that there are no links for cut messages, which makes choqok sort of useless as most of the displayed messages are cut (I assume at 140 characters) and there is no easy way to see the rest, not even via a link that you can open in the browser by a click. Coming back to version 1.6 :( (In reply to avlas from comment #38) > One issue I can see in master version, I recall it now I saw it before too, > is that there are no links for cut messages, which makes choqok sort of > useless as most of the displayed messages are cut (I assume at 140 > characters) and there is no easy way to see the rest, not even via a link > that you can open in the browser by a click. > > Coming back to version 1.6 :( I can only reproduce this with cited tweets. And in any case, you can always open it by clicking on the timestamp. Even if this is no longer being developed, a release in its current state would be a great improvement. (In reply to Antonio Rojas from comment #39) > I can only reproduce this with cited tweets. And in any case, you can always > open it by clicking on the timestamp. That's right I just did some tests here and I can confirm Choqok 1.6 actually CAN post 280-char tweets - just pay attention to the character counter until it hits -140. It will not only post the tweet - when you check out your profile on Twitter website, it shows the entire text, not the shortened one as shown in Choqok's main window. Based on that, I imagine it IS possible to actually upgrade the character counter to 280 somehow. (In reply to Eliseu Cendron Carvalho from comment #41) > I just did some tests here and I can confirm Choqok 1.6 actually CAN post > 280-char tweets - just pay attention to the character counter until it hits > -140. It will not only post the tweet - when you check out your profile on > Twitter website, it shows the entire text, not the shortened one as shown in > Choqok's main window. > Based on that, I imagine it IS possible to actually upgrade the character > counter to 280 somehow. Oh yes, it works when creating a tweet, but the feature most expected by everyone is to be able to read messages of more than 140 characters without clicking on the link to open the browser and read more. Unfortunately the 1.7 release still has the RT issue, which is fixed by Frédéric patch in Comment 32 - can this please be merged? Git commit e5e60a1692fe7bed0e3537bef63747ef100d643f by Andrea Scarpino, on behalf of Frédéric Brière. Committed on 05/02/2020 at 23:48. Pushed by scarpino into branch 'master'. 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.) M +1 -1 microblogs/twitter/twittermicroblog.cpp https://invent.kde.org/kde/choqok/commit/e5e60a1692fe7bed0e3537bef63747ef100d643f Thank you! *** Bug 417841 has been marked as a duplicate of this bug. *** |