hatkidchan / mastoposter

Mastodon to [anything] reposter. Anything being {Telegram, Discord} for now.
GNU General Public License v3.0
28 stars 3 forks source link

Telegram "Link to post" incorrect URL #49

Closed Generator closed 9 months ago

Generator commented 1 year ago

Using user = all Wrong URLs on "Link to post"

It should post https://mstdn.social/@warmapper/110650352956748281 Instead posts URL https://mstdn.social/@warmapper/110650353387634151

On log the URL is correct
[ INFO:root] New status: https://mstdn.social/users/warmapper/statuses/110650352956748281

Template:

template = {% if status.reblog %}Boost from <a href="{{status.reblog.account.url}}">{{status.reblog.account.name}}</a>
    {% endif %}{% if status.reblog_or_status.spoiler_text %}{{status.reblog_or_status.spoiler_text}}
    <tg-spoiler>{% endif %}{{ status.reblog_or_status.content_flathtml }}{% if status.reblog_or_status.spoiler_text %}</tg-spoiler>{% endif %}

    <a href="{{status.link}}">Link to post</a>
hatkidchan commented 1 year ago

Hm. You could use status.uri instead of status.link, but on some instances it could just lead to unexpected results (such as JSON source of the post being linked instead of post itself). Does that happen regularly and only when reposting statuses of other users? I could add more verbosity so we could see raw event and figure out where wrong ID comes from

Generator commented 1 year ago

Is a public channel, you can look here https://t.me/s/ukrainerussialivenews

Im going to try with status.uri

hatkidchan commented 1 year ago

It seems like some posts are not accessible by their IDs, huh.. I've never ran into that issue before, so it remained unnoticed. Maybe it's also instance-specific problem. Maybe it depends on post visibility. I don't know. I don't use Mastodon anymore, so I can't test a lot of things, but my friend runs Mastodon instance and she's not having any problems like that one..

Generator commented 1 year ago

status.uri seems to fix the issue for now, i'll notice if there other issues with this.

hatkidchan commented 9 months ago

Closing for inactivity, feel free to reopen it if issue appears again