From 8ee9abdd69da42ed6080b8aad4687d2261cafc11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Mon, 14 Oct 2019 15:43:56 +0200 Subject: basetabs: return a copy of ChatTab.jid to prevent nasty (mutability) side-effects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- poezio/tabs/basetabs.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'poezio') 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: -- cgit v1.2.3