xep_0045: also return default value when attr doesn't exist

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2020-07-08 10:21:16 +02:00
parent 200e1a6128
commit c8d1eaa2dc
Signed by: pep
GPG key ID: DEDA74AEECA9D0F2

View file

@ -29,7 +29,7 @@ class MUCBase(ElementBase):
item = self.xml.find(f'{{{NS_USER}}}item')
if item is None:
return default
return item.get(attr)
return item.get(attr, default)
def set_item_attr(self, attr, value: str):
item = self.xml.find(f'{{{NS_USER}}}item')