Mercurial > libervia-backend
comparison sat/plugins/plugin_xep_0045.py @ 2584:f8e4d855001e
plugin XEP-0045: display a note when no configuration is available on the room
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 11 May 2018 18:18:06 +0200 |
parents | 8378806a70fe |
children | 9680cd958529 |
comparison
equal
deleted
inserted
replaced
2583:8378806a70fe | 2584:f8e4d855001e |
---|---|
278 except KeyError: | 278 except KeyError: |
279 log.error(_("room_jid key is not present !")) | 279 log.error(_("room_jid key is not present !")) |
280 return defer.fail(exceptions.DataError) | 280 return defer.fail(exceptions.DataError) |
281 | 281 |
282 def xmluiReceived(xmlui): | 282 def xmluiReceived(xmlui): |
283 if not xmlui: | |
284 msg = D_(u"No configuration available for this room") | |
285 return {"xmlui": xml_tools.note(msg).toXml()} | |
283 return {"xmlui": xmlui.toXml()} | 286 return {"xmlui": xmlui.toXml()} |
284 return self.configureRoom(client, room_jid).addCallback(xmluiReceived) | 287 return self.configureRoom(client, room_jid).addCallback(xmluiReceived) |
285 | 288 |
286 def configureRoom(self, client, room_jid): | 289 def configureRoom(self, client, room_jid): |
287 """return the room configuration form | 290 """return the room configuration form |