diff options
Diffstat (limited to 'sleekxmpp/plugins/xep_0332/stanza/response.py')
-rw-r--r-- | sleekxmpp/plugins/xep_0332/stanza/response.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/sleekxmpp/plugins/xep_0332/stanza/response.py b/sleekxmpp/plugins/xep_0332/stanza/response.py index d863efa3..0fc46de8 100644 --- a/sleekxmpp/plugins/xep_0332/stanza/response.py +++ b/sleekxmpp/plugins/xep_0332/stanza/response.py @@ -41,17 +41,21 @@ class Response(ElementBase): name = 'response' namespace = 'urn:xmpp:http' - interfaces = set(['code', 'version']) + interfaces = set(['code', 'message', 'version']) plugin_attrib = 'resp' def get_code(self): - print "Response:: get_code()" + code = self._get_attr('statusCode', None) + return int(code) if code is not None else code def set_code(self, code): - print "Response:: set_code()" self._set_attr('statusCode', str(code)) - self._set_attr('statusMessage', str(code)) + + def get_message(self): + return self._get_attr('statusMessage', '') + + def set_message(self, message): + self._set_attr('statusMessage', message) def set_version(self, version='1.1'): - print "Response:: set_version()" self._set_attr('version', version) |