Mercurial > libervia-backend
comparison src/plugins/plugin_xep_0095.py @ 2129:6a66c8c5a567
core: replaced calls to client.xmlstream.send by client.send which is the right method to use. client.xmlstream should not be used directly
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 04 Feb 2017 17:59:13 +0100 |
parents | 2daf7b4c6756 |
children | 1d3f73e065e1 |
comparison
equal
deleted
inserted
replaced
2128:aa94f33fd2ad | 2129:6a66c8c5a567 |
---|---|
107 | 107 |
108 iq_error_elt = error.StanzaError(condition).toResponse(request) | 108 iq_error_elt = error.StanzaError(condition).toResponse(request) |
109 if si_condition is not None: | 109 if si_condition is not None: |
110 iq_error_elt.error.addElement((NS_SI, si_condition)) | 110 iq_error_elt.error.addElement((NS_SI, si_condition)) |
111 | 111 |
112 client.xmlstream.send(iq_error_elt) | 112 client.send(iq_error_elt) |
113 | 113 |
114 def acceptStream(self, iq_elt, feature_elt, misc_elts=None, profile=C.PROF_KEY_NONE): | 114 def acceptStream(self, iq_elt, feature_elt, misc_elts=None, profile=C.PROF_KEY_NONE): |
115 """Send the accept stream initiation answer | 115 """Send the accept stream initiation answer |
116 | 116 |
117 @param iq_elt(domish.Element): initial SI request | 117 @param iq_elt(domish.Element): initial SI request |
126 result_elt = xmlstream.toResponse(iq_elt, 'result') | 126 result_elt = xmlstream.toResponse(iq_elt, 'result') |
127 si_elt = result_elt.addElement((NS_SI, 'si')) | 127 si_elt = result_elt.addElement((NS_SI, 'si')) |
128 si_elt.addChild(feature_elt) | 128 si_elt.addChild(feature_elt) |
129 for elt in misc_elts: | 129 for elt in misc_elts: |
130 si_elt.addChild(elt) | 130 si_elt.addChild(elt) |
131 client.xmlstream.send(result_elt) | 131 client.send(result_elt) |
132 | 132 |
133 def _parseOfferResult(self, iq_elt): | 133 def _parseOfferResult(self, iq_elt): |
134 try: | 134 try: |
135 si_elt = iq_elt.elements(NS_SI, "si").next() | 135 si_elt = iq_elt.elements(NS_SI, "si").next() |
136 except StopIteration: | 136 except StopIteration: |