comparison src/plugins/plugin_xep_0095.py @ 398:cb0285372818

File transfer: - proxy managed in XEP-0065 (Socks5 bytestream) - bug: fixed a bad id used during stream negociation
author Goffi <goffi@goffi.org>
date Wed, 05 Oct 2011 16:49:57 +0200
parents 8f3551ceee17
children cf005701624b
comparison
equal deleted inserted replaced
397:ccfd69d090c3 398:cb0285372818
73 @param iq_el: IQ element 73 @param iq_el: IQ element
74 @param profile: %(doc_profile)s""" 74 @param profile: %(doc_profile)s"""
75 info (_("XEP-0095 Stream initiation")) 75 info (_("XEP-0095 Stream initiation"))
76 iq_el.handled=True 76 iq_el.handled=True
77 si_el = iq_el.firstChildElement() 77 si_el = iq_el.firstChildElement()
78 si_id = iq_el.getAttribute('id') 78 si_id = si_el.getAttribute('id')
79 si_mime_type = iq_el.getAttribute('mime-type', 'application/octet-stream') 79 si_mime_type = iq_el.getAttribute('mime-type', 'application/octet-stream')
80 si_profile = si_el.getAttribute('profile') 80 si_profile = si_el.getAttribute('profile')
81 si_profile_key = si_profile[len(SI_PROFILE_HEADER):] if si_profile.startswith(SI_PROFILE_HEADER) else si_profile 81 si_profile_key = si_profile[len(SI_PROFILE_HEADER):] if si_profile.startswith(SI_PROFILE_HEADER) else si_profile
82 if self.si_profiles.has_key(si_profile_key): 82 if self.si_profiles.has_key(si_profile_key):
83 #We know this SI profile, we call the callback 83 #We know this SI profile, we call the callback
84 self.si_profiles[si_profile_key](iq_el['from'], si_id, si_mime_type, si_el, profile) 84 self.si_profiles[si_profile_key](iq_el['id'], iq_el['from'], si_id, si_mime_type, si_el, profile)
85 else: 85 else:
86 #We don't know this profile, we send an error 86 #We don't know this profile, we send an error
87 self.sendBadProfileError(iq_el['id'], iq_el['from'], profile) 87 self.sendBadProfileError(iq_el['id'], iq_el['from'], profile)
88 88
89 def sendRejectedError(self, iq_id, to_jid, reason = 'Offer Declined', profile='@NONE@'): 89 def sendRejectedError(self, iq_id, to_jid, reason = 'Offer Declined', profile='@NONE@'):