diff --git a/sleekxmpp/plugins/xep_0085.py b/sleekxmpp/plugins/xep_0085.py index e183ec2..e24e9db 100644 --- a/sleekxmpp/plugins/xep_0085.py +++ b/sleekxmpp/plugins/xep_0085.py @@ -38,8 +38,9 @@ class ChatState(ElementBase): def setState(self, state): if state in self.states: self.name = state - self.xml.tag = state - self.xml.attrib['xmlns'] = self.namespace + self.xml.tag = '{%s}%s' % (self.namespace, state) + else: + raise ValueError('Invalid chat state') def getState(self): return self.name