From cb4e60c4813d2f91be8ad2f98e6e3fe488a0d518 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Philipp=20H=C3=B6rist?= <philipp@hoerist.com>
Date: Wed, 3 Apr 2019 23:45:33 +0200
Subject: [PATCH] Dont send invalid presence show value

---
 gajim/common/modules/presence.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gajim/common/modules/presence.py b/gajim/common/modules/presence.py
index dee33b3cbe..d150870764 100644
--- a/gajim/common/modules/presence.py
+++ b/gajim/common/modules/presence.py
@@ -175,6 +175,10 @@ class Presence:
     def get_presence(self, to=None, typ=None, priority=None,
                      show=None, status=None, nick=None, caps=True,
                      sign=None, idle_time=None):
+        if show not in ('chat', 'away', 'xa', 'dnd'):
+            # Gajim sometimes passes invalid show values here
+            # until this is fixed this is a workaround
+            show = None
         presence = nbxmpp.Presence(to, typ, priority, show, status)
         if nick is not None:
             nick_tag = presence.setTag('nick', namespace=nbxmpp.NS_NICK)
-- 
GitLab