xep_0106.py 612 B

1234567891011121314151617181920212223242526
  1. """
  2. SleekXMPP: The Sleek XMPP Library
  3. Copyright (C) 2012 Nathanael C. Fritz, Lance J.T. Stout
  4. This file is part of SleekXMPP.
  5. See the file LICENSE for copying permission.
  6. """
  7. from sleekxmpp.plugins import BasePlugin, register_plugin
  8. class XEP_0106(BasePlugin):
  9. name = 'xep_0106'
  10. description = 'XEP-0106: JID Escaping'
  11. dependencies = set(['xep_0030'])
  12. def session_bind(self, jid):
  13. self.xmpp['xep_0030'].add_feature(feature='jid\\20escaping')
  14. def plugin_end(self):
  15. self.xmpp['xep_0030'].del_feature(feature='jid\\20escaping')
  16. register_plugin(XEP_0106)