python-matrix-bot-api icon indicating copy to clipboard operation
python-matrix-bot-api copied to clipboard

Bug in use of rooms variable / access control to bot

Open chrisfahr opened this issue 7 years ago • 2 comments

Hi, there is an issue with your usage of the rooms variable. In matrix_bot_api.py line 43 (else branch) you try to use it like an array of room objects. This fails in line 46 when you try to assign handlers. In the other branch you store (string) ids in it. Then again in line 71 you store objects. This prevents one from using rooms in the constructor to limit access to the bot.

chrisfahr avatar Feb 28 '18 01:02 chrisfahr

Good catch. I suppose I'll update all branches to treat them as an array of string room ids, unless you think room objects would be better?

shawnanastasio avatar Feb 28 '18 19:02 shawnanastasio

I think using strings is fine. Otherwise an user of the libary would have to call the underlying API to get the room objects, which kind of contradicts the use case that he has in the first place.

chrisfahr avatar Mar 16 '18 23:03 chrisfahr