mastodon-api icon indicating copy to clipboard operation
mastodon-api copied to clipboard

Status.reblogged? returns false even with a reblog attribute set

Open renatolond opened this issue 6 years ago • 4 comments

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.

renatolond avatar Aug 08 '17 14:08 renatolond

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.

Gargron avatar Aug 08 '17 15:08 Gargron

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.

renatolond avatar Aug 08 '17 15:08 renatolond

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

hakanai avatar Oct 20 '17 03:10 hakanai

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

renatolond avatar Oct 20 '17 14:10 renatolond