mastodon-api
mastodon-api copied to clipboard
Status.reblogged? returns false even with a reblog attribute set
I'm testing a status that has a reblog and even thought the reblog attribute is set to another status, calling reblogged? returns false because the reblogged attribute is also set to false.
reblog
: If that status is a reblog, this contains the original status being reblogged
reblogged?
: Whether you (the authenticated user) have reblogged the status
They are orthogonal.
Hm, but how can I check if a status is a reblog? Because I saw that calling reblog on a status that is not a reblog raises a:
> s.reblog
NoMethodError: undefined method `fetch' for nil:NilClass
That's why I assumed the reblogged?
method was to check if the status itself was a reblog.
The docs on #reblog
don't state what the method actually does at all so I guess it can just return random status objects and it's behaving "correctly"... o_o
Well, I've extended the lib with something like this to be able to do what I wanted:
https://github.com/renatolond/mastodon-twitter-poster/blob/master/lib/mastodon_ext.rb#L3-L10