summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2016-10-08 22:40:03 +0100
committermathieui <mathieui@mathieui.net>2016-10-09 17:06:33 +0200
commitf8d5fa9b1cc85f1565d475ceedb6ced9652351b7 (patch)
treed13449e298aeae543c28d6968446b361622987cc
parent4ad066b39bd31f1525570bd4ec70c35380e7c15d (diff)
downloadpoezio-f8d5fa9b1cc85f1565d475ceedb6ced9652351b7.tar.gz
poezio-f8d5fa9b1cc85f1565d475ceedb6ced9652351b7.tar.bz2
poezio-f8d5fa9b1cc85f1565d475ceedb6ced9652351b7.tar.xz
poezio-f8d5fa9b1cc85f1565d475ceedb6ced9652351b7.zip
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.
-rw-r--r--data/default_config.cfg8
-rw-r--r--doc/source/commands.rst4
-rw-r--r--doc/source/configuration.rst10
-rw-r--r--poezio/config.py1
-rw-r--r--poezio/connection.py6
5 files changed, 4 insertions, 25 deletions
diff --git a/data/default_config.cfg b/data/default_config.cfg
index dd98e493..d8ec3705 100644
--- a/data/default_config.cfg
+++ b/data/default_config.cfg
@@ -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
diff --git a/doc/source/commands.rst b/doc/source/commands.rst
index 8c0e0d5b..64a2f033 100644
--- a/doc/source/commands.rst
+++ b/doc/source/commands.rst
@@ -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>``
diff --git a/doc/source/configuration.rst b/doc/source/configuration.rst
index 4a1af1eb..131915c9 100644
--- a/doc/source/configuration.rst
+++ b/doc/source/configuration.rst
@@ -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]``
diff --git a/poezio/config.py b/poezio/config.py
index 15380b8b..f2002382 100644
--- a/poezio/config.py
+++ b/poezio/config.py
@@ -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,
diff --git a/poezio/connection.py b/poezio/connection.py
index 7b12a6eb..be030497 100644
--- a/poezio/connection.py
+++ b/poezio/connection.py
@@ -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