Remove the resource option from the configuration.

It’s considered bad practice nowadays to force a specific resource, it
can lead to presence leaks or reconnection loops so should be avoided.

Moreover this was already possible in the jid option, by setting it to
user@domain/resource, setting it would append it a second time in that
case.
This commit is contained in:
Emmanuel Gil Peyrot 2016-10-08 22:40:03 +01:00 committed by mathieui
parent 4ad066b39b
commit f8d5fa9b1c
5 changed files with 4 additions and 25 deletions

View file

@ -11,7 +11,7 @@
# account on a server. This is optional and useful only for some features,
# like room administration, nickname registration.
# The 'server' option will be ignored if you specify a JID (Jabber identifier)
# It should be in the form nickname@server.tld
# It should be in the form nickname@server.tld or nickname@server.tld/resource
jid =
# A password is needed only if you specified a jid. It will be ignored otherwise
@ -49,12 +49,6 @@ highlight_on =
# Colon-separated list of plugins to load on startup
plugins_autoload =
# the resource you will use
# If it's empty, your resource will be chosen (most likely randomly) by the server
# It is not recommended to use a resource that is easy to guess, because it can lead
# to presence leak.
resource =
# The server used for anonymous connection.
# Make sure the server you're using accepts anonymous authentication
#server = anon.jeproteste.info

View file

@ -138,7 +138,7 @@ These commands work in *any* tab.
Set the value to the option in
your configuration file. You can, for example, change your default nickname
by doing "/set default_nick toto" or your resource with "/set resource
by doing "/set default_nick toto" or your password with "/set password
blabla". Doing so will write in the main config file, and in the main
section ([Poezio]). But you can also write to another section, with ``/set
bindings M-i ^i``, to a plugin configuration with ``/set mpd_client| host
@ -152,7 +152,7 @@ These commands work in *any* tab.
**Usage:** ``/set_default [section] <option>``
Set the value of an option back to the default. For example,
``/set_default resource`` will reset the ``resource`` option.
``/set_default password`` will reset the ``password`` option.
/toggle
**Usage:** ``/toggle <option>``

View file

@ -110,7 +110,7 @@ Options related to account configuration, nickname…
account on a server. This is optional and useful only for some features,
like room administration or nickname registration.
The :term:`server` option will be ignored if you specify a JID (Jabber id)
It should be in the form nickname@server.tld
It should be in the form nickname@server.tld or nickname@server.tld/resource
custom_host
@ -172,14 +172,6 @@ Options related to account configuration, nickname…
through SASL External. If set, :term:`keyfile` **MUST** be set as well
in order to login.
resource
**Default value:** ``[empty]``
The resource you will use. If it's empty, your resource will be chosen
(most likely randomly) by the server. It is not recommended to use a
resource that is easy to guess, because it can lead to presence leak.
rooms
**Default value:** ``[empty]``

View file

@ -95,7 +95,6 @@ DEFAULT_CONFIG = {
'private_auto_response': '',
'remote_fifo_path': './',
'request_message_receipts': True,
'resource': '',
'rooms': '',
'roster_group_sort': 'name',
'roster_show_offline': False,

View file

@ -32,8 +32,6 @@ class Connection(slixmpp.ClientXMPP):
"""
__init = False
def __init__(self):
resource = config.get('resource')
keyfile = config.get('keyfile')
certfile = config.get('certfile')
@ -43,8 +41,6 @@ class Connection(slixmpp.ClientXMPP):
# depending on this setting
self.anon = False
jid = '%s' % config.get('jid')
if resource:
jid = '%s/%s'% (jid, resource)
password = config.get('password')
eval_password = config.get('eval_password')
if not password and not eval_password and not (keyfile and certfile):
@ -63,8 +59,6 @@ class Connection(slixmpp.ClientXMPP):
else: # anonymous auth
self.anon = True
jid = config.get('server')
if resource:
jid = '%s/%s' % (jid, resource)
password = None
jid = safeJID(jid)
# TODO: use the system language