changeset bff0a35ffdc7 in /home/hg/repos/gajim-plugins
author: Jefry Lagrange <jefry.reyes(a)gmail.com>
branches:
details:gajim-plugins?cmd=changeset;node=bff0a35ffdc7
description: file sharing. Send offer to jid with resource
diffstat:
file_sharing/fshare_protocol.py | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diffs (30 lines):
diff -r 1ffb3c9ead46 -r bff0a35ffdc7 file_sharing/fshare_protocol.py
--- a/file_sharing/fshare_protocol.py Fri Oct 04 23:52:46 2013 +0400
+++ b/file_sharing/fshare_protocol.py Tue Nov 05 19:26:28 2013 +0000
@@ -118,14 +118,15 @@
# TODO: reply with malformed stanza error
pass
- def on_toplevel_request(self, stanza, jid):
+ def on_toplevel_request(self, stanza, fjid):
+ jid = get_jid_without_resource(fjid)
roots = self.plugin.database.get_toplevel_dirs(self.account, jid)
items = []
for root in roots:
items.append({'type' : 'directory',
'name' : root[0]
})
- return self.offer(stanza.getID(), jid, None, items)
+ return self.offer(stanza.getID(), fjid, None, items)
def on_dir_request(self, stanza, fjid, jid, dir_):
result = self.plugin.database.get_files_from_dir(self.account, jid, dir_)
@@ -139,7 +140,7 @@
return -1
node = stanza.getQuery().getAttr('node')
if node is None:
- return self.on_toplevel_request(stanza, jid)
+ return self.on_toplevel_request(stanza, fjid)
result = self.plugin.database.get_file(self.account, jid, None, node)
if result == []:
return self.offer(stanza.getID(), fjid, node, result)