From a335c9ec46651e029703a97a3d5ec2d46f68a077 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Sun, 3 Nov 2019 22:07:00 +0100 Subject: Revert "Refactor XHTML event code" This reverts commit 05e74605cf99c5955b3e09bd2b2c51c071416952 --- nbxmpp/structs.py | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'nbxmpp/structs.py') diff --git a/nbxmpp/structs.py b/nbxmpp/structs.py index 4512704..77bf605 100644 --- a/nbxmpp/structs.py +++ b/nbxmpp/structs.py @@ -26,7 +26,6 @@ from nbxmpp.protocol import NS_MAM_2 from nbxmpp.protocol import NS_MUC from nbxmpp.protocol import NS_MUC_INFO from nbxmpp.protocol import NS_CLIENT -from nbxmpp.protocol import NS_XHTML from nbxmpp.protocol import Protocol from nbxmpp.const import MessageType from nbxmpp.const import AvatarState @@ -832,26 +831,3 @@ class PresenceProperties: return self.muc_user.role except Exception: return None - - -class XHTMLData: - def __init__(self, xhtml): - self._bodys = {} - for body in xhtml.getTags('body', namespace=NS_XHTML): - lang = body.getXmlLang() - self._bodys[lang] = body - - def get_body(self, pref_lang=None): - if pref_lang is not None: - body = self._bodys.get(pref_lang) - if body is not None: - return str(body) - - body = self._bodys.get('en') - if body is not None: - return str(body) - - body = self._bodys.get(None) - if body is not None: - return str(body) - return str(self._bodys.popitem()[1]) -- cgit v1.2.3