-
kousu
xmpp["xep_0045"].get_joined_rooms() doesn't take a pfrom like the other methods in that plugin https://codeberg.org/poezio/slixmpp/src/commit/d1be300c66514f85f077d283626101a12cfe646e/slixmpp/plugins/xep_0045/muc.py#L867-L871 Is that an oversight? I think it means that get_joined_rooms(msg['to']) fails unless self["xep_0045"].config["multi_from"]=True. The other methods all do a check internally to handle that: - https://codeberg.org/poezio/slixmpp/src/commit/d1be300c66514f85f077d283626101a12cfe646e/slixmpp/plugins/xep_0045/muc.py#L220-L223 - https://codeberg.org/poezio/slixmpp/src/commit/d1be300c66514f85f077d283626101a12cfe646e/slixmpp/plugins/xep_0045/muc.py#L245-L249 - https://codeberg.org/poezio/slixmpp/src/commit/d1be300c66514f85f077d283626101a12cfe646e/slixmpp/plugins/xep_0045/muc.py#L386-L391✎ -
kousu
xmpp["xep_0045"].get_joined_rooms() doesn't take a pfrom like the other methods in that plugin https://codeberg.org/poezio/slixmpp/src/commit/d1be300c66514f85f077d283626101a12cfe646e/slixmpp/plugins/xep_0045/muc.py#L867-L871 Is that an oversight? I think it means that get_joined_rooms(msg['to']) fails unless self["xep_0045"].multi_from=True. The other methods all do a check internally to handle that: - https://codeberg.org/poezio/slixmpp/src/commit/d1be300c66514f85f077d283626101a12cfe646e/slixmpp/plugins/xep_0045/muc.py#L220-L223 - https://codeberg.org/poezio/slixmpp/src/commit/d1be300c66514f85f077d283626101a12cfe646e/slixmpp/plugins/xep_0045/muc.py#L245-L249 - https://codeberg.org/poezio/slixmpp/src/commit/d1be300c66514f85f077d283626101a12cfe646e/slixmpp/plugins/xep_0045/muc.py#L386-L391 ✏
-
mathieui
kousu, > xmpp["xep_0045"].get_joined_rooms() doesn't take a pfrom like the other methods in that plugin the link you provide clearly shows that it does? I am confused
-
kousu
Hiya, what I mean is it doesn't do the 'None if not self.multi_from' calcuation like the other paths do.
-
kousu
In the other paths it's safe to pass msg['to'] in directly because that will always do the right thing in either mode.
-
mathieui
kousu, the multi_from as well as the pfrom is to be used in the case of a components where you have to juggle multiple "from" when sending stanzas. In the case where we use multi_from it is because in handlers there is no user input to tell us which JID to check. In get_joined_rooms you call the method so you normally know if it makes sense to pass a JID
-
mathieui
Sure, we could add a check, alongside a warning that it makes no sense to do that
-
mathieui
but pfrom is always useless at best in a client
-
kousu
I'm calling this from a handler too.
-
mathieui
yes, but you write the code, so you know if that makes sense for you to add
-
kousu
And I'm trying to make a plugin so I don't know if I'm in multi_from mode or not.
-
mathieui
this plugin is going to apply to both clients and components? (it’s usually a tricky design and a messier interface)
-
kousu
I haven't thought that through fully
-
kousu
I didn't want to constrain anyone's dreams unnecessarily
-
kousu
but okay so, it is intentionally like that. That's all I need to know for now. Thank you for sharing :)
-
mathieui
all the other methods will return the wrong results if you give them a pfrom as well, as far as I can see