Commit f8d5fa9b authored by Link Mauve's avatar Link Mauve Committed by mathieui

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.
parent 4ad066b3
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
# account on a server. This is optional and useful only for some features, # account on a server. This is optional and useful only for some features,
# like room administration, nickname registration. # like room administration, nickname registration.
# The 'server' option will be ignored if you specify a JID (Jabber identifier) # 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 = jid =
# A password is needed only if you specified a jid. It will be ignored otherwise # A password is needed only if you specified a jid. It will be ignored otherwise
...@@ -49,12 +49,6 @@ highlight_on = ...@@ -49,12 +49,6 @@ highlight_on =
# Colon-separated list of plugins to load on startup # Colon-separated list of plugins to load on startup
plugins_autoload = 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. # The server used for anonymous connection.
# Make sure the server you're using accepts anonymous authentication # Make sure the server you're using accepts anonymous authentication
#server = anon.jeproteste.info #server = anon.jeproteste.info
......
...@@ -138,7 +138,7 @@ These commands work in *any* tab. ...@@ -138,7 +138,7 @@ These commands work in *any* tab.
Set the value to the option in Set the value to the option in
your configuration file. You can, for example, change your default nickname 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 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 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 bindings M-i ^i``, to a plugin configuration with ``/set mpd_client| host
...@@ -152,7 +152,7 @@ These commands work in *any* tab. ...@@ -152,7 +152,7 @@ These commands work in *any* tab.
**Usage:** ``/set_default [section] <option>`` **Usage:** ``/set_default [section] <option>``
Set the value of an option back to the default. For example, 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 /toggle
**Usage:** ``/toggle <option>`` **Usage:** ``/toggle <option>``
......
...@@ -110,7 +110,7 @@ Options related to account configuration, nickname… ...@@ -110,7 +110,7 @@ Options related to account configuration, nickname…
account on a server. This is optional and useful only for some features, account on a server. This is optional and useful only for some features,
like room administration or nickname registration. like room administration or nickname registration.
The :term:`server` option will be ignored if you specify a JID (Jabber id) 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 custom_host
...@@ -172,14 +172,6 @@ Options related to account configuration, nickname… ...@@ -172,14 +172,6 @@ Options related to account configuration, nickname…
through SASL External. If set, :term:`keyfile` **MUST** be set as well through SASL External. If set, :term:`keyfile` **MUST** be set as well
in order to login. 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 rooms
**Default value:** ``[empty]`` **Default value:** ``[empty]``
......
...@@ -95,7 +95,6 @@ DEFAULT_CONFIG = { ...@@ -95,7 +95,6 @@ DEFAULT_CONFIG = {
'private_auto_response': '', 'private_auto_response': '',
'remote_fifo_path': './', 'remote_fifo_path': './',
'request_message_receipts': True, 'request_message_receipts': True,
'resource': '',
'rooms': '', 'rooms': '',
'roster_group_sort': 'name', 'roster_group_sort': 'name',
'roster_show_offline': False, 'roster_show_offline': False,
......
...@@ -32,8 +32,6 @@ class Connection(slixmpp.ClientXMPP): ...@@ -32,8 +32,6 @@ class Connection(slixmpp.ClientXMPP):
""" """
__init = False __init = False
def __init__(self): def __init__(self):
resource = config.get('resource')
keyfile = config.get('keyfile') keyfile = config.get('keyfile')
certfile = config.get('certfile') certfile = config.get('certfile')
...@@ -43,8 +41,6 @@ class Connection(slixmpp.ClientXMPP): ...@@ -43,8 +41,6 @@ class Connection(slixmpp.ClientXMPP):
# depending on this setting # depending on this setting
self.anon = False self.anon = False
jid = '%s' % config.get('jid') jid = '%s' % config.get('jid')
if resource:
jid = '%s/%s'% (jid, resource)
password = config.get('password') password = config.get('password')
eval_password = config.get('eval_password') eval_password = config.get('eval_password')
if not password and not eval_password and not (keyfile and certfile): if not password and not eval_password and not (keyfile and certfile):
...@@ -63,8 +59,6 @@ class Connection(slixmpp.ClientXMPP): ...@@ -63,8 +59,6 @@ class Connection(slixmpp.ClientXMPP):
else: # anonymous auth else: # anonymous auth
self.anon = True self.anon = True
jid = config.get('server') jid = config.get('server')
if resource:
jid = '%s/%s' % (jid, resource)
password = None password = None
jid = safeJID(jid) jid = safeJID(jid)
# TODO: use the system language # TODO: use the system language
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment