* Added safe-er way to unpack data from instances
-> like, now we're passing only the fields that
we really need, not just everything that was
sent by out our instance. that fixes pleroma
being weird and adding pleroma field to some
of objects, which was causing KeyError to be
raised. this should be fixed now but I'm not
completely sure so that's why it's in unsafe
branch of the project. oh wow also this comm
message is looking funky. hahahahah. ok bai.
When boosting something, status contents are not stored in status
itself, but rather in the `status.reblog`. Since it'd be really awkward
to check for boosts too, I just decided to add separate `@property` that
returns either reblog or status itself, depending on the value of
`status.reblog`. That required a bit of tweaking. Also now we're using
ExtendedInterpolation, so you can do the `${tokens.telegram}` and add
separate section for your secrets.
TODO: add support for environment variables (maybe)
For those who's wondering how manual check for boost would look in the
template, here ya go :)
{% if status.reblog %}Boost from <a \
href="{{status.reblog.account.url}}">{{status.reblog.account.name}}</a>
{% if status.reblog.spoiler_text %}{{status.reblog.spoiler_text}}
<tg-spoiler>{% endif %}{{status.reblog.content_flathtml}}\
{% if status.reblog.spoiler_text %}</tg-spoiler>{% endif %}
{% else %}
{% if status.spoiler_text %}{{status.spoiler_text}}
<tg-spoiler>{% endif %}{{status.content_flathtml}}\
{% if status.spoiler_text %}</tg-spoiler>{% endif %}
{% endif %}
<a href="{{status.link}}">Link to post</a>
You asked for this :)