matrix-nio icon indicating copy to clipboard operation
matrix-nio copied to clipboard

Request for API Method to Fetch All Public Server Rooms

Open TrevisGordan opened this issue 1 year ago • 1 comments

Hello,

I'm currently exploring the matrix-nio library and I've encountered an issue. It seems there isn't a straightforward nio.API call or method available to fetch all public server rooms, similar to what's described in the Matrix Client-Server API spec:
GET /_matrix/client/v3/publicRooms.

Is this functionality not implemented in matrix-nio? If it's missing, could you please provide some insight into why? Additionally, if it is indeed not implemented, would you be interested in a pull request to add this feature?

Thank you for your assistance.

TrevisGordan avatar Apr 18 '24 18:04 TrevisGordan

Thanks @TrevisGordan; I think this is an important ommission to fix; it's indeed not yet implemented. The most likely reason I can think of is that it's not in the typical "bot" usecase that most people use matrix-nio for, but that's not a reason not to implement it.

I'd definitely be happy to accept a PR that implemented this; if you see that I've self-assigned myself this in the future, it probably means I'm working on it.

PaarthShah avatar May 06 '24 02:05 PaarthShah

@TrevisGordan Published with matrix-nio==0.25.0rc3

Docs: https://matrix-nio.readthedocs.io/en/latest/nio.html#nio.AsyncClient.list_public_rooms

PaarthShah avatar Jun 01 '24 22:06 PaarthShah

Hey @PaarthShah , amazing! Thanks for just going ahead and directly implementing it! 

TrevisGordan avatar Jun 03 '24 09:06 TrevisGordan

@TrevisGordan No problem! It didn't take super long and it was a good thing to have available!

PaarthShah avatar Jun 03 '24 14:06 PaarthShah