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
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
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
Peter Shkenev
gajim
Commits
fbcb9640
Commit
fbcb9640
authored
19 years ago
by
dkirov
Browse files
Options
Downloads
Patches
Plain Diff
'send_message' and 'start-chat' is executed only for
connected accounts
parent
e9d80f65
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/remote_control.py
+24
-17
24 additions, 17 deletions
src/remote_control.py
with
24 additions
and
17 deletions
src/remote_control.py
+
24
−
17
View file @
fbcb9640
...
...
@@ -129,15 +129,19 @@ def send_message(self, *args):
return
None
# or raise error
if
not
keyID
:
keyID
=
''
if
account
:
self
.
plugin
.
connections
[
account
].
send_message
(
jid
,
message
,
keyID
)
connected_account
=
None
if
account
and
\
gajim
.
connections
[
account
].
connected
>
1
:
# account is online
connected_account
=
gajim
.
connections
[
account
]
else
:
for
account
in
gajim
.
contacts
.
keys
():
if
gajim
.
contacts
[
account
].
has_key
(
jid
):
if
gajim
.
contacts
[
account
].
has_key
(
jid
)
and
\
gajim
.
connections
[
account
].
connected
>
1
:
# account is online
connected_account
=
gajim
.
connections
[
account
]
break
if
account
:
res
=
gajim
.
connect
ions
[
account
]
.
send_message
(
jid
,
message
,
keyID
)
return
True
if
connected_
account
:
res
=
connect
ed_
account
.
send_message
(
jid
,
message
,
keyID
)
return
True
return
False
def
open_chat
(
self
,
*
args
):
...
...
@@ -153,19 +157,22 @@ def open_chat(self, *args):
accounts
=
[
account
]
else
:
accounts
=
gajim
.
connections
.
keys
()
connected_account
=
None
for
account
in
accounts
:
if
self
.
plugin
.
windows
[
account
][
'
chats
'
].
has_key
(
jid
):
self
.
plugin
.
windows
[
account
][
'
chats
'
][
jid
].
set_active_tab
(
jid
)
break
elif
gajim
.
contacts
[
account
].
has_key
(
jid
):
if
self
.
plugin
.
windows
[
account
][
'
chats
'
].
has_key
(
jid
)
and
\
gajim
.
connections
[
account
].
connected
>
1
:
# account is online
connected_account
=
account
break
self
.
plugin
.
roster
.
new_chat_from_jid
(
account
,
jid
)
# preserve the 'steal focus preservation'
win
=
self
.
plugin
.
windows
[
account
][
'
chats
'
][
jid
].
window
if
win
.
get_property
(
'
visible
'
):
win
.
window
.
focus
()
elif
gajim
.
connections
[
account
].
connected
>
1
:
# account is online
connected_account
=
account
if
gajim
.
contacts
[
account
].
has_key
(
jid
):
break
if
connected_account
:
self
.
plugin
.
roster
.
new_chat_from_jid
(
connected_account
,
jid
)
# preserve the 'steal focus preservation'
win
=
self
.
plugin
.
windows
[
connected_account
][
'
chats
'
][
jid
].
window
if
win
.
get_property
(
'
visible
'
):
win
.
window
.
focus
()
def
change_status
(
self
,
*
args
,
**
keywords
):
'''
change_status(status, message, account). account is optional -
...
...
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