summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime “pep” Buquet <pep@bouah.net>2019-10-14 15:43:56 +0200
committerMaxime “pep” Buquet <pep@bouah.net>2019-10-14 15:43:56 +0200
commit8ee9abdd69da42ed6080b8aad4687d2261cafc11 (patch)
tree8bac441d107ab183d1a88bb11980d233c935834b
parent7587b954e313c116d38db4c128271363a80fed19 (diff)
downloadpoezio-8ee9abdd69da42ed6080b8aad4687d2261cafc11.tar.gz
poezio-8ee9abdd69da42ed6080b8aad4687d2261cafc11.tar.bz2
poezio-8ee9abdd69da42ed6080b8aad4687d2261cafc11.tar.xz
poezio-8ee9abdd69da42ed6080b8aad4687d2261cafc11.zip
basetabs: return a copy of ChatTab.jid to prevent nasty (mutability) side-effects
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
-rw-r--r--poezio/tabs/basetabs.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/poezio/tabs/basetabs.py b/poezio/tabs/basetabs.py
index 6e4d9553..0cae3c6a 100644
--- a/poezio/tabs/basetabs.py
+++ b/poezio/tabs/basetabs.py
@@ -13,6 +13,7 @@ This module also defines ChatTabs, the parent class for all tabs
revolving around chats.
"""
+import copy
import logging
import string
import asyncio
@@ -538,7 +539,7 @@ class ChatTab(Tab):
@property
def jid(self) -> JID:
- return self._jid
+ return copy.copy(self._jid)
@jid.setter
def jid(self, value: JID) -> None: