do not allow to drop a group on itself or a subgroup of itself. Fixes #8211

This commit is contained in:
Yann Leboulanger 2016-01-03 13:02:22 +01:00
parent cb8993f51d
commit ec74544a88
1 changed files with 6 additions and 2 deletions

View File

@ -4800,6 +4800,10 @@ class RosterWindow:
if type_dest == 'account': if type_dest == 'account':
new_grp = grp_source_list[-1] new_grp = grp_source_list[-1]
elif type_dest == 'group': elif type_dest == 'group':
grp_dest = model[iter_dest][C_JID]
grp_dest_list = grp_dest.split(delimiter)
# Do not allow to drop on a subgroup of source group
if grp_source_list[0] != grp_dest_list[0]:
new_grp = model[iter_dest][C_JID] + delimiter + \ new_grp = model[iter_dest][C_JID] + delimiter + \
grp_source_list[-1] grp_source_list[-1]
if new_grp: if new_grp: