jp (file/send): don't add main resource to bare jid anymore:
bare jid sending is now managed by backend (at least for Jingle), so resource must not be added automatically anymore.
This commit is contained in:
parent
f4c7f5e55e
commit
ed39d5340d
2 changed files with 6 additions and 5 deletions
|
|
@ -874,6 +874,8 @@ class Jp(object):
|
|||
|
||||
async def get_full_jid(self, param_jid):
|
||||
"""Return the full jid if possible (add main resource when find a bare jid)"""
|
||||
# TODO: to be removed, bare jid should work with all commands, notably for file
|
||||
# as backend now handle jingles message initiation
|
||||
_jid = JID(param_jid)
|
||||
if not _jid.resource:
|
||||
#if the resource is not given, we try to add the main resource
|
||||
|
|
|
|||
|
|
@ -95,13 +95,13 @@ class Send(base.CommandBase):
|
|||
@param file_(str): file path
|
||||
"""
|
||||
# FIXME: this show progress only for last progress_id
|
||||
self.disp(_("File request sent to {jid}".format(jid=self.full_dest_jid)), 1)
|
||||
self.disp(_("File request sent to {jid}".format(jid=self.args.jid)), 1)
|
||||
try:
|
||||
await self.set_progress_id(data["progress"])
|
||||
except KeyError:
|
||||
# TODO: if 'xmlui' key is present, manage xmlui message display
|
||||
self.disp(
|
||||
_("Can't send file to {jid}".format(jid=self.full_dest_jid)), error=True
|
||||
_("Can't send file to {jid}".format(jid=self.args.jid)), error=True
|
||||
)
|
||||
self.host.quit(2)
|
||||
|
||||
|
|
@ -116,7 +116,6 @@ class Send(base.CommandBase):
|
|||
)
|
||||
self.host.quit(C.EXIT_BAD_ARG)
|
||||
|
||||
self.full_dest_jid = await self.host.get_full_jid(self.args.jid)
|
||||
extra = {}
|
||||
if self.args.path:
|
||||
extra["path"] = self.args.path
|
||||
|
|
@ -142,7 +141,7 @@ class Send(base.CommandBase):
|
|||
|
||||
try:
|
||||
send_data = await self.host.bridge.fileSend(
|
||||
self.full_dest_jid,
|
||||
self.args.jid,
|
||||
buf.name,
|
||||
self.args.name or archive_name,
|
||||
"",
|
||||
|
|
@ -159,7 +158,7 @@ class Send(base.CommandBase):
|
|||
path = os.path.abspath(file_)
|
||||
try:
|
||||
send_data = await self.host.bridge.fileSend(
|
||||
self.full_dest_jid,
|
||||
self.args.jid,
|
||||
path,
|
||||
self.args.name,
|
||||
"",
|
||||
|
|
|
|||
Loading…
Reference in a new issue