Mercurial > libervia-backend
diff src/plugins/plugin_xep_0095.py @ 587:952322b1d490
Remove trailing whitespaces.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Fri, 18 Jan 2013 17:55:34 +0100 |
parents | ca13633d3b6b |
children | beaf6bec2fcd |
line wrap: on
line diff
--- a/src/plugins/plugin_xep_0095.py Fri Jan 18 17:55:27 2013 +0100 +++ b/src/plugins/plugin_xep_0095.py Fri Jan 18 17:55:34 2013 +0100 @@ -58,9 +58,9 @@ info(_("Plugin XEP_0095 initialization")) self.host = host self.si_profiles = {} #key: SI profile, value: callback - + def getHandler(self, profile): - return XEP_0095_handler(self) + return XEP_0095_handler(self) def registerSIProfile(self, si_profile, callback): """Add a callback for a SI Profile @@ -107,14 +107,14 @@ @param to_jid: recipient @param profile: %(doc_profile)s""" self.sendError(iq_id, to_jid, 400, 'cancel', profile=profile) - + def sendFailedError(self, iq_id, to_jid, profile): """Helper method to send when we transfer failed @param iq_id: IQ id @param to_jid: recipient @param profile: %(doc_profile)s""" self.sendError(iq_id, to_jid, 500, 'cancel', {'custom':'failed'}, profile=profile) #as there is no error code for failed transfer, we use 500 (undefined-condition) - + def sendError(self, iq_id, to_jid, err_code, err_type='cancel', data={}, profile='@NONE@'): """Send IQ error as a result @param iq_id: IQ id @@ -129,7 +129,7 @@ result = domish.Element((None, 'iq')) result['type'] = 'result' result['id'] = iq_id - result['to'] = to_jid + result['to'] = to_jid error_el = result.addElement('error') error_el['err_code'] = str(err_code) error_el['type'] = err_type @@ -162,7 +162,7 @@ result = domish.Element((None, 'iq')) result['type'] = 'result' result['id'] = iq_id - result['to'] = to_jid + result['to'] = to_jid si = result.addElement('si', NS_SI) si.addChild(feature_elt) for elt in misc_elts: @@ -182,9 +182,9 @@ if not xmlstream: error (_('Asking for an non-existant or not connected profile')) return "" - + offer = client.IQ(xmlstream,'set') - sid = str(uuid.uuid4()) + sid = str(uuid.uuid4()) debug (_("Stream Session ID: %s") % offer["id"]) offer["from"] = current_jid.full() @@ -200,10 +200,10 @@ offer.send() return sid, offer - + class XEP_0095_handler(XMPPHandler): implements(iwokkel.IDisco) - + def __init__(self, plugin_parent): self.plugin_parent = plugin_parent self.host = plugin_parent.host