Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
gajim
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ge0rG
gajim
Commits
299351c1
Commit
299351c1
authored
Nov 24, 2020
by
Philipp Hörist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add /disco command
parent
1fa2c4b5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
0 deletions
+31
-0
gajim/command_system/implementation/standard.py
gajim/command_system/implementation/standard.py
+9
-0
gajim/common/modules/discovery.py
gajim/common/modules/discovery.py
+22
-0
No files found.
gajim/command_system/implementation/standard.py
View file @
299351c1
...
...
@@ -169,6 +169,15 @@ def online(self, message):
continue
connection
.
change_status
(
'online'
,
message
)
@
command
@
doc
(
_
(
"Send a disco info request"
))
def
disco
(
self
):
client
=
app
.
get_client
(
self
.
account
)
if
not
client
.
state
.
is_available
:
return
client
.
get_module
(
'Discovery'
).
disco_contact
(
self
.
contact
)
class
StandardCommonChatCommands
(
CommandContainer
):
"""
...
...
gajim/common/modules/discovery.py
View file @
299351c1
...
...
@@ -238,6 +238,28 @@ def disco_muc(self,
yield
result
@
as_task
def
disco_contact
(
self
,
contact
):
_task
=
yield
fjid
=
contact
.
get_full_jid
()
result
=
yield
self
.
disco_info
(
fjid
)
if
is_error
(
result
):
raise
result
self
.
_log
.
info
(
'Disco Info received: %s'
,
fjid
)
app
.
storage
.
cache
.
set_last_disco_info
(
result
.
jid
,
result
,
cache_only
=
True
)
app
.
nec
.
push_incoming_event
(
NetworkEvent
(
'caps-update'
,
account
=
self
.
_account
,
fjid
=
fjid
,
jid
=
contact
.
jid
))
def
get_instance
(
*
args
,
**
kwargs
):
return
Discovery
(
*
args
,
**
kwargs
),
'Discovery'
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment