comparison libervia/backend/plugins/plugin_xep_0045.py @ 4196:8b673bb307c1

plugin XEP-0045: avoir crash if `subject` is not set when `_get_room_joined_args` is called.
author Goffi <goffi@goffi.org>
date Wed, 13 Dec 2023 22:00:25 +0100
parents 6784d07b99c8
children a7d4007a8fa5
comparison
equal deleted inserted replaced
4195:22cd3094cd1e 4196:8b673bb307c1
276 def _get_room_joined_args(self, room, profile): 276 def _get_room_joined_args(self, room, profile):
277 return [ 277 return [
278 room.roomJID.userhost(), 278 room.roomJID.userhost(),
279 XEP_0045._get_occupants(room), 279 XEP_0045._get_occupants(room),
280 room.nick, 280 room.nick,
281 room.subject, 281 # FIXME: getattr below is a Q&D fix as `subject` may not be set in early call
282 # of _get_rooms_joined (during `join` call). The whole workflow of this
283 # plugin should be refactored.
284 getattr(room, "subject", ""),
282 [s.name for s in room.statuses], 285 [s.name for s in room.statuses],
283 profile 286 profile
284 ] 287 ]
285 288
286 def _ui_room_join_cb(self, data, profile): 289 def _ui_room_join_cb(self, data, profile):