From 79fd3d7c13f05785fb29a768c45f08aec7dc3794 Mon Sep 17 00:00:00 2001 From: Goffi Date: Wed, 13 Dec 2023 22:00:25 +0100 Subject: [PATCH] plugin XEP-0045: avoir crash if `subject` is not set when `_get_room_joined_args` is called. --- libervia/backend/plugins/plugin_xep_0045.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libervia/backend/plugins/plugin_xep_0045.py b/libervia/backend/plugins/plugin_xep_0045.py index 39ca9d36..2b69f6a3 100644 --- a/libervia/backend/plugins/plugin_xep_0045.py +++ b/libervia/backend/plugins/plugin_xep_0045.py @@ -278,7 +278,10 @@ class XEP_0045(object): room.roomJID.userhost(), XEP_0045._get_occupants(room), room.nick, - room.subject, + # FIXME: getattr below is a Q&D fix as `subject` may not be set in early call + # of _get_rooms_joined (during `join` call). The whole workflow of this + # plugin should be refactored. + getattr(room, "subject", ""), [s.name for s in room.statuses], profile ]