diff --git a/gajim/common/modules/message.py b/gajim/common/modules/message.py
index 00fad4f2fcce0ff6164178e9360f5156ef4ea0c6..d3bfdb4af9c86d1af8c49effb9727ad2fe45fd24 100644
--- a/gajim/common/modules/message.py
+++ b/gajim/common/modules/message.py
@@ -163,6 +163,7 @@ class Message:
                 # TODO: why is this here?
                 if stanza.getTag('html'):
                     stanza.delChild('html')
+            type_ = 'groupchat'
 
         session = None
         if type_ != 'groupchat':