Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
eta
gajim
Commits
e4a28f65
Commit
e4a28f65
authored
19 years ago
by
dkirov
Browse files
Options
Downloads
Patches
Plain Diff
added send_file remote command
parent
a51c3202
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
scripts/gajim-remote.py
+9
-0
9 additions, 0 deletions
scripts/gajim-remote.py
src/filetransfers_window.py
+5
-0
5 additions, 0 deletions
src/filetransfers_window.py
src/gajim.py
+1
-0
1 addition, 0 deletions
src/gajim.py
src/remote_control.py
+36
-1
36 additions, 1 deletion
src/remote_control.py
with
51 additions
and
1 deletion
scripts/gajim-remote.py
+
9
−
0
View file @
e4a28f65
...
...
@@ -136,6 +136,15 @@ sent using this account'), False),
[
(
'
jid
'
,
_
(
'
JID of the contact
'
),
True
)
]
],
'
send_file
'
:
[
_
(
'
Send file to a contact
'
),
[
(
_
(
'
file
'
),
_
(
'
File path
'
),
True
),
(
'
jid
'
,
_
(
'
JID of the contact
'
),
True
),
(
_
(
'
account
'
),
_
(
'
if specified, file will be sent
\
using this account
'
),
False
)
]
]
}
if
self
.
argv_len
<
2
or
\
...
...
This diff is collapsed.
Click to expand it.
src/filetransfers_window.py
+
5
−
0
View file @
e4a28f65
...
...
@@ -253,6 +253,11 @@ _('Connection with peer cannot be established.'))
def
send_file
(
self
,
account
,
contact
,
file_path
):
'''
start the real transfer(upload) of the file
'''
if
type
(
contact
)
==
str
:
if
contact
.
find
(
'
/
'
)
==
-
1
:
return
(
jid
,
resource
)
=
contact
.
split
(
"
/
"
,
1
)
contact
=
gajim
.
Contact
(
jid
=
jid
,
resource
=
resource
)
(
file_dir
,
file_name
)
=
os
.
path
.
split
(
file_path
)
file_props
=
self
.
get_send_file_props
(
account
,
contact
,
file_path
,
file_name
)
...
...
This diff is collapsed.
Click to expand it.
src/gajim.py
+
1
−
0
View file @
e4a28f65
...
...
@@ -339,6 +339,7 @@ class Interface:
self
.
roster
.
popup_notification_windows
.
append
(
instance
)
if
self
.
remote
and
self
.
remote
.
is_enabled
():
self
.
remote
.
raise_signal
(
'
ContactAbsence
'
,
(
account
,
array
))
# stop non active file transfers
elif
self
.
windows
[
account
][
'
gc
'
].
has_key
(
ji
):
#it is a groupchat presence
...
...
This diff is collapsed.
Click to expand it.
src/remote_control.py
+
36
−
1
View file @
e4a28f65
...
...
@@ -100,7 +100,8 @@ class SignalObject(DbusPrototype):
self
.
change_status
,
self
.
open_chat
,
self
.
send_message
,
self
.
contact_info
self
.
contact_info
,
self
.
send_file
])
def
raise_signal
(
self
,
signal
,
arg
):
...
...
@@ -121,6 +122,39 @@ class SignalObject(DbusPrototype):
def
VcardInfo
(
self
,
*
vcard
):
pass
def
send_file
(
self
,
*
args
):
'''
send_file(file_path, jid, account=None)
send file, located at
'
file_path
'
to
'
jid
'
, using account
(optional)
'
account
'
'''
file_path
,
jid
,
account
=
self
.
_get_real_arguments
(
args
,
3
)
accounts
=
gajim
.
contacts
.
keys
()
# if there is only one account in roster, take it as default
if
not
account
and
len
(
accounts
)
==
1
:
account
=
accounts
[
0
]
if
account
:
if
gajim
.
connections
[
account
].
connected
>
1
:
# account is online
connected_account
=
gajim
.
connections
[
account
]
else
:
for
account
in
accounts
:
if
gajim
.
contacts
[
account
].
has_key
(
jid
)
and
\
gajim
.
connections
[
account
].
connected
>
1
:
# account is online
connected_account
=
gajim
.
connections
[
account
]
break
if
gajim
.
contacts
.
has_key
(
account
)
and
\
gajim
.
contacts
[
account
].
has_key
(
jid
):
contact
=
gajim
.
get_highest_prio_contact_from_contacts
(
gajim
.
contacts
[
account
][
jid
])
else
:
contact
=
jid
if
connected_account
:
if
os
.
path
.
isfile
(
file_path
):
# is it file?
self
.
plugin
.
windows
[
'
file_transfers
'
].
send_file
(
account
,
contact
,
file_path
)
return
True
return
False
def
send_message
(
self
,
*
args
):
'''
send_message(jid, message, keyID=None, account=None)
send
'
message
'
to
'
jid
'
, using account (optional)
'
account
'
.
...
...
@@ -394,6 +428,7 @@ class SignalObject(DbusPrototype):
open_chat
=
method
(
INTERFACE
)(
open_chat
)
contact_info
=
method
(
INTERFACE
)(
contact_info
)
send_message
=
method
(
INTERFACE
)(
send_message
)
send_file
=
method
(
INTERFACE
)(
send_file
)
VcardInfo
=
signal
(
INTERFACE
)(
VcardInfo
)
class
SessionBusNotPresent
(
Exception
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment