summaryrefslogtreecommitdiff
path: root/poezio/tabs/basetabs.py
diff options
context:
space:
mode:
authorMaxime “pep” Buquet <pep@bouah.net>2020-05-08 15:10:25 +0200
committerMaxime “pep” Buquet <pep@bouah.net>2020-05-08 15:10:25 +0200
commite2dc69f9e1da9bb3b5924f606791a52a260e76fd (patch)
treed368b7d9532e9ad348ed314f59019839772418ae /poezio/tabs/basetabs.py
parent4edf690e26481e917be65efafb6a40a0e19061e2 (diff)
downloadpoezio-e2dc69f9e1da9bb3b5924f606791a52a260e76fd.tar.gz
poezio-e2dc69f9e1da9bb3b5924f606791a52a260e76fd.tar.bz2
poezio-e2dc69f9e1da9bb3b5924f606791a52a260e76fd.tar.xz
poezio-e2dc69f9e1da9bb3b5924f606791a52a260e76fd.zip
Chatstates: add <x/> in MUC-PMs
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
Diffstat (limited to 'poezio/tabs/basetabs.py')
-rw-r--r--poezio/tabs/basetabs.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/poezio/tabs/basetabs.py b/poezio/tabs/basetabs.py
index 9026e8be..fca54860 100644
--- a/poezio/tabs/basetabs.py
+++ b/poezio/tabs/basetabs.py
@@ -48,6 +48,8 @@ if TYPE_CHECKING:
log = logging.getLogger(__name__)
+NS_MUC_USER = 'http://jabber.org/protocol/muc#user'
+
# getters for tab colors (lambdas, so that they are dynamic)
STATE_COLORS = {
'disconnected': lambda: get_theme().COLOR_TAB_DISCONNECTED,
@@ -688,6 +690,8 @@ class ChatTab(Tab):
"""
Send an empty chatstate message
"""
+ from poezio.tabs import PrivateTab
+
if self.check_send_chat_state():
if state in ('active', 'inactive',
'gone') and self.inactive and not always_send:
@@ -698,6 +702,9 @@ class ChatTab(Tab):
msg['chat_state'] = state
self.chat_state = state
msg['no-store'] = True
+ if isinstance(self, PrivateTab):
+ x = ET.Element('{%s}x' % NS_MUC_USER)
+ msg.append(x)
msg.send()
return True