Feature request: add ability to fetch account & status id on origin instance
I am working on 'Open on origin instance' feature in Fedi
mobile client for Pleroma/Mastodon.
Main idea: load data from origin instance (remote server for the current user, for example, lain.com
if user sees lain@lain.com
account) via public API endpoints /api/v1/accounts/:id
, /api/v1/statuses/:id
, /api/v1/statuses/:id/context
, /api/v1/accounts/:id/statuses
and display it in the app on separate instead of launching web browser. It may be useful because data (status threads-conversations, account statuses) maybe not fully be synchronized between instances.
I have already implemented this feature, but I used hacks, so I think it requires to rework. Main issue: it is not possible to find account ID and status ID on the origin instance. The same status has different IDs on different instances.
Current feature state
Origin remote instance is MASTODON
Statuses
Status
"uri": "https://newsbots.eu/users/anarchismnews/statuses/105644117668009685",
"url": "https://newsbots.eu/@anarchismnews/105644117668009685",
I am parsing status id on remote origin instance from url
field.
Accounts
I always have access to at least one account status. So I parse status id as described above and use account id from status response.
Origin remote instance is PLEROMA
Accounts
Fetch account details by passing nickname(username) instead of id
as described in docs - https://docs-develop.pleroma.social/backend/development/API/differences_in_mastoapi_responses/#accounts
Statuses
Status on local instance
"uri": "https://fedi.app/objects/8f79e48f-a545-47db-ae49-72bf94b28c6b",
"url": "https://fedi.app/notice/A3fv3GurbhUIlTrCGe",
Status on the origin remote instance
"uri": "https://shigusegubu.club/objects/327a2f39-9190-4882-ac16-787fc6a7d11e",
"url": "https://shigusegubu.club/objects/327a2f39-9190-4882-ac16-787fc6a7d11e",
As you can see it is not possible to parse the status id on the origin instance from url
field
Possible workarounds:
- include
origin_instance_id
in pleroma object (inside account & status). Perhaps with special 'with_origin_instance_id' argument to requests. In this case, I can just use origin IDs from json response - Make status
url
field similar to Mastodon, so I can fetch origin instance status id fromurl
.