session-pysogs icon indicating copy to clipboard operation
session-pysogs copied to clipboard

make `/rooms` return the url to join each room directly

Open Bilb opened this issue 2 years ago • 5 comments

Currently a client needs to build the url to join a room from the /rooms response itself.

It would be nice to have that fullUrl (with publicKey) returned as part of the room details directly.

Currently, the returned entries are like this:

[{
"active_users":2170,
"active_users_cutoff":604800,
"admins":["15adbf86be09641d73cad2d25f3fb69084383f230e7f1ae77c51e4451b5b6c1100","15c6807a9933310392a26de0cf9635fba1535b2b9296c9eb6a060481d51b8983a7","15e114772c8577b03f30d2cdbd22d985059ed12b7e47958a8aaf98656b1eedfb08"],
"created":1674795646.097481,
"description":"The official announcement channel for information about Lokinet",
"image_id":27956,
"info_updates":3,
"message_sequence":1675,
"moderators":["15fec070711e4e699ca3ef112104659d4e9f5ab21494e778503d173ed4ec4beb04"],
"name":"Lokinet Updates",
"read":true,
"token":"lokinet-updates",
"upload":false,
"write":false
}
...
]

Bilb avatar Feb 27 '23 04:02 Bilb

SOGS doesn't necessarily have (or know) the base URL you are using, e.g. you might be using https://abc.example.org but that might also be accessible at http://example.org:5678.

jagerman avatar Feb 27 '23 23:02 jagerman

do we set a base url in config that returns the same thing in the sogs -L that we could use?

0x330a avatar Mar 01 '23 05:03 0x330a

if a client is able to request /rooms it should already know that information, without it how could it request that endpoint?

majestrate avatar Mar 01 '23 13:03 majestrate

This is somewhat related to #185.

mdPlusPlus avatar Apr 11 '23 10:04 mdPlusPlus

Just found my comment about this issue again in my code, but I wanted this as it is usually how you interact with rest APIs. Each responses gives you the link to use to navigate between pages. Pagination have full for the next and preivous page, etc https://stackoverflow.com/questions/30981727/link-to-another-resource-in-a-rest-api-by-its-id-or-by-its-url I understand that the joining url might not be part of that response though. Just something I kind of expected to get.

Bilb avatar May 18 '23 00:05 Bilb