comparison src/plugins/plugin_xep_0096.py @ 291:7c79d4a8c9e6

plugins: fixed bad import names
author Goffi <goffi@goffi.org>
date Sun, 06 Feb 2011 23:49:27 +0100
parents b1794cbb88e5
children f964dcec1611
comparison
equal deleted inserted replaced
290:59a82af700e2 291:7c79d4a8c9e6
41 NS_SI = 'http://jabber.org/protocol/si' 41 NS_SI = 'http://jabber.org/protocol/si'
42 SI_REQUEST = IQ_SET + '/si[@xmlns="' + NS_SI + '"]' 42 SI_REQUEST = IQ_SET + '/si[@xmlns="' + NS_SI + '"]'
43 43
44 PLUGIN_INFO = { 44 PLUGIN_INFO = {
45 "name": "XEP 0096 Plugin", 45 "name": "XEP 0096 Plugin",
46 "import_name": "XEP_0096", 46 "import_name": "XEP-0096",
47 "type": "XEP", 47 "type": "XEP",
48 "protocols": ["XEP-0096"], 48 "protocols": ["XEP-0096"],
49 "dependencies": ["XEP_0065"], 49 "dependencies": ["XEP-0065"],
50 "main": "XEP_0096", 50 "main": "XEP_0096",
51 "handler": "yes", 51 "handler": "yes",
52 "description": _("""Implementation of SI File Transfert""") 52 "description": _("""Implementation of SI File Transfert""")
53 } 53 }
54 54
83 83
84 def confirmationCB(self, id, accepted, data): 84 def confirmationCB(self, id, accepted, data):
85 """Called on confirmation answer""" 85 """Called on confirmation answer"""
86 if accepted: 86 if accepted:
87 data['size'] = self._waiting_for_approval[id][2] 87 data['size'] = self._waiting_for_approval[id][2]
88 self.host.plugins["XEP_0065"].setData(data, id) 88 self.host.plugins["XEP-0065"].setData(data, id)
89 self.approved(id) 89 self.approved(id)
90 else: 90 else:
91 debug (_("Transfert [%s] refused"), id) 91 debug (_("Transfert [%s] refused"), id)
92 del(self._waiting_for_approval[id]) 92 del(self._waiting_for_approval[id])
93 93
159 statinfo = os.stat(filepath) 159 statinfo = os.stat(filepath)
160 160
161 offer=client.IQ(xmlstream,'set') 161 offer=client.IQ(xmlstream,'set')
162 debug ("Transfert ID: %s", offer["id"]) 162 debug ("Transfert ID: %s", offer["id"])
163 163
164 self.host.plugins["XEP_0065"].sendFile(offer["id"], filepath, str(statinfo.st_size)) 164 self.host.plugins["XEP-0065"].sendFile(offer["id"], filepath, str(statinfo.st_size))
165 165
166 offer["from"]=current_jid.full() 166 offer["from"]=current_jid.full()
167 offer["to"]=jid.JID(to).full() 167 offer["to"]=jid.JID(to).full()
168 si=offer.addElement('si','http://jabber.org/protocol/si') 168 si=offer.addElement('si','http://jabber.org/protocol/si')
169 si["mime-type"]='text/plain' 169 si["mime-type"]='text/plain'