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
poezio
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
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Maxime Buquet
poezio
Commits
92265678
Verified
Commit
92265678
authored
Dec 17, 2014
by
mathieui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add completions for /cert_add and /cert_fetch
parent
2bb4f45e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
2 deletions
+32
-2
src/tabs/rostertab.py
src/tabs/rostertab.py
+32
-2
No files found.
src/tabs/rostertab.py
View file @
92265678
...
...
@@ -162,7 +162,8 @@ class RosterInfoTab(Tab):
' if a client connected using this certificate can'
' manage the certificates itself.'
),
shortdesc
=
_
(
'Add a client certificate.'
),
usage
=
'<name> <certificate path> [management]'
)
usage
=
'<name> <certificate path> [management]'
,
completion
=
self
.
completion_cert_add
)
self
.
register_command
(
'cert_disable'
,
self
.
command_cert_disable
,
desc
=
_
(
'Remove a certificate from the list '
'of allowed ones. Clients currently '
...
...
@@ -181,7 +182,8 @@ class RosterInfoTab(Tab):
desc
=
_
(
'Retrieve a certificate with its '
'name. It will be stored in <path>.'
),
shortdesc
=
_
(
'Fetch a certificate'
),
usage
=
'<name> <path>'
)
usage
=
'<name> <path>'
,
completion
=
self
.
completion_cert_fetch
)
@
command_args_parser
.
ignored
def
command_certs
(
self
):
...
...
@@ -245,6 +247,21 @@ class RosterInfoTab(Tab):
self
.
core
.
xmpp
.
plugin
[
'xep_0257'
].
add_cert
(
name
,
crt
,
callback
=
cb
,
allow_management
=
management
)
def
completion_cert_add
(
self
,
the_input
):
"""
completion for /cert_add <name> <path> [management]
"""
text
=
the_input
.
get_text
()
args
=
common
.
shell_split
(
text
)
n
=
the_input
.
get_argument_position
()
log
.
debug
(
'%s %s %s'
,
the_input
.
text
,
n
,
the_input
.
pos
)
if
n
==
1
:
return
elif
n
==
2
:
return
self
.
completion_file
(
2
,
the_input
)
elif
n
==
3
:
return
the_input
.
new_completion
([
'true'
,
'false'
],
n
)
@
command_args_parser
.
quoted
(
1
)
def
command_cert_disable
(
self
,
args
):
"""
...
...
@@ -313,6 +330,19 @@ class RosterInfoTab(Tab):
self
.
core
.
xmpp
.
plugin
[
'xep_0257'
].
get_certs
(
callback
=
cb
)
def
completion_cert_fetch
(
self
,
the_input
):
"""
completion for /cert_fetch <name> <path>
"""
text
=
the_input
.
get_text
()
args
=
common
.
shell_split
(
text
)
n
=
the_input
.
get_argument_position
()
log
.
debug
(
'%s %s %s'
,
the_input
.
text
,
n
,
the_input
.
pos
)
if
n
==
1
:
return
elif
n
==
2
:
return
self
.
completion_file
(
2
,
the_input
)
def
on_blocked_message
(
self
,
message
):
"""
When we try to send a message to a blocked contact
...
...
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