From ccf5baadff46b5b36d84d8a4e9321b4a8c894519 Mon Sep 17 00:00:00 2001
From: Yann Leboulanger <asterix@lagaule.org>
Date: Sun, 26 Oct 2014 16:43:44 +0100
Subject: [PATCH] [bluec0re] Fix bug when server assign a contact to a group
 with empty name. Fixes #7865

---
 src/common/contacts.py | 2 +-
 src/roster_window.py   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/common/contacts.py b/src/common/contacts.py
index 586caadf58..72d496263e 100644
--- a/src/common/contacts.py
+++ b/src/common/contacts.py
@@ -99,7 +99,7 @@ class Contact(CommonContact):
             our_chatstate, chatstate, client_caps=client_caps)
 
         self.contact_name = '' # nick choosen by contact
-        self.groups = [i for i in set(groups)] # filter duplicate values
+        self.groups = [i if i else _('General') for i in set(groups)] # filter duplicate values
 
         self.sub = sub
         self.ask = ask
diff --git a/src/roster_window.py b/src/roster_window.py
index 42bb73f29b..3c775d4cb4 100644
--- a/src/roster_window.py
+++ b/src/roster_window.py
@@ -299,7 +299,7 @@ class RosterWindow:
         delimiter = gajim.connections[account].nested_group_delimiter
         group_splited = group.split(delimiter)
         parent_group = delimiter.join(group_splited[:-1])
-        if parent_group in self._iters[account_group]['groups']:
+        if len(group_splited) > 1 and parent_group in self._iters[account_group]['groups']:
             iter_parent = self._iters[account_group]['groups'][parent_group]
         elif parent_group:
             iter_parent = self._add_group_iter(account, parent_group)
-- 
GitLab