From 89f2afd0485771337e0f49bc11df7751178343bf Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Sun, 5 Mar 2006 10:19:36 +0000 Subject: [PATCH] Be sure not to create a loop when we drag parent on one of his child. Fixes #1656 --- src/roster_window.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/roster_window.py b/src/roster_window.py index 501d1b8c5..5fa7d2728 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -2837,6 +2837,12 @@ _('If "%s" accepts this request you will know his or her status.') % jid) # if context.action == gtk.gdk.ACTION_COPY: # # Keep only MOVE # return + c_dest = gajim.contacts.get_contact_with_highest_priority(account, + jid_dest) + # are we creating a loop (child is parent and parent is child)? + if gajim.contacts.is_subcontact(account, c_dest) and \ + gajim.contacts.get_parent_contact(account, c_dest).jid == jid_source: + return gajim.contacts.add_subcontact(account, jid_dest, jid_source) # remove the source row context.finish(True, True, etime)