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
42d74e39
Commit
42d74e39
authored
18 years ago
by
jimpp
Browse files
Options
Downloads
Patches
Plain Diff
[maciekp] Send single message with gajim-remote, fixes #2026.
parent
f757025e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/gajim-remote.py
+17
-3
17 additions, 3 deletions
src/gajim-remote.py
src/remote_control.py
+23
-1
23 additions, 1 deletion
src/remote_control.py
with
40 additions
and
4 deletions
src/gajim-remote.py
+
17
−
3
View file @
42d74e39
...
...
@@ -126,7 +126,7 @@ class GajimRemote:
]
],
'
send_message
'
:[
_
(
'
Sends new message to a contact in the roster. Both OpenPGP key
'
_
(
'
Sends new
chat
message to a contact in the roster. Both OpenPGP key
'
'
and account are optional. If you want to set only
\'
account
\'
,
'
'
without
\'
OpenPGP key
\'
, just set
\'
OpenPGP key
\'
to
\'\'
.
'
),
[
...
...
@@ -137,6 +137,20 @@ class GajimRemote:
(
_
(
'
account
'
),
_
(
'
if specified, the message will be sent
'
'
using this account
'
),
False
),
]
],
'
send_single_message
'
:[
_
(
'
Sends new single message to a contact in the roster. Both OpenPGP key
'
'
and account are optional. If you want to set only
\'
account
\'
,
'
'
without
\'
OpenPGP key
\'
, just set
\'
OpenPGP key
\'
to
\'\'
.
'
),
[
(
'
jid
'
,
_
(
'
JID of the contact that will receive the message
'
),
True
),
(
_
(
'
subject
'
),
_
(
'
message subject
'
),
True
),
(
_
(
'
message
'
),
_
(
'
message contents
'
),
True
),
(
_
(
'
pgp key
'
),
_
(
'
if specified, the message will be encrypted
'
'
using this public key
'
),
False
),
(
_
(
'
account
'
),
_
(
'
if specified, the message will be sent
'
'
using this account
'
),
False
),
]
],
'
contact_info
'
:
[
_
(
'
Gets detailed info on a contact
'
),
...
...
@@ -252,8 +266,8 @@ class GajimRemote:
def
print_result
(
self
,
res
):
'''
Print retrieved result to the output
'''
if
res
is
not
None
:
if
self
.
command
in
(
'
open_chat
'
,
'
send_message
'
,
'
start_chat
'
):
if
self
.
command
==
'
send
_message
'
:
if
self
.
command
in
(
'
open_chat
'
,
'
send_message
'
,
'
send_single_message
'
,
'
start_chat
'
):
if
self
.
command
in
(
'
send_message
'
,
'
send_single
_message
'
)
:
self
.
argv_len
-=
2
if
res
is
False
:
...
...
This diff is collapsed.
Click to expand it.
src/remote_control.py
+
23
−
1
View file @
42d74e39
...
...
@@ -159,6 +159,7 @@ class SignalObject(DbusPrototype):
self
.
change_status
,
self
.
open_chat
,
self
.
send_message
,
self
.
send_single_message
,
self
.
contact_info
,
self
.
send_file
,
self
.
prefs_list
,
...
...
@@ -251,7 +252,7 @@ class SignalObject(DbusPrototype):
def
send_message
(
self
,
*
args
):
'''
send_message(jid, message, keyID=None, account=None)
send
'
message
'
to
'
jid
'
, using account (optional)
'
account
'
.
send
chat
'
message
'
to
'
jid
'
, using account (optional)
'
account
'
.
if keyID is specified, encrypt the message with the pgp key
'''
jid
,
message
,
keyID
,
account
=
self
.
_get_real_arguments
(
args
,
4
)
if
not
jid
or
not
message
:
...
...
@@ -267,6 +268,26 @@ class SignalObject(DbusPrototype):
return
True
return
False
def
send_single_message
(
self
,
*
args
):
'''
send_single_message(jid, subject, message, keyID=None, account=None)
send single
'
message
'
to
'
jid
'
, using account (optional)
'
account
'
.
if keyID is specified, encrypt the message with the pgp key
'''
jid
,
subject
,
message
,
keyID
,
account
=
self
.
_get_real_arguments
(
args
,
5
)
if
not
jid
or
not
message
:
return
None
# or raise error
if
not
keyID
:
keyID
=
''
connected_account
,
contact
=
self
.
get_account_and_contact
(
account
,
jid
)
if
connected_account
:
connection
=
gajim
.
connections
[
connected_account
]
res
=
connection
.
send_message
(
jid
,
message
,
keyID
,
type
=
'
normal
'
,
subject
=
subject
)
return
True
return
False
def
open_chat
(
self
,
*
args
):
'''
start_chat(jid, account=None) -> shows the tabbed window for new
message to
'
jid
'
, using account(optional)
'
account
'
'''
...
...
@@ -578,6 +599,7 @@ class SignalObject(DbusPrototype):
open_chat
=
method
(
INTERFACE
)(
open_chat
)
contact_info
=
method
(
INTERFACE
)(
contact_info
)
send_message
=
method
(
INTERFACE
)(
send_message
)
send_single_message
=
method
(
INTERFACE
)(
send_single_message
)
send_file
=
method
(
INTERFACE
)(
send_file
)
prefs_list
=
method
(
INTERFACE
)(
prefs_list
)
prefs_put
=
method
(
INTERFACE
)(
prefs_put
)
...
...
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