# HG changeset patch # User Mikael Berthe # Date 1132958929 -3600 # Node ID 887c1bd37617da55f80f8369db343c914119ad58 # Parent ffdfddd351b87318f2ba2412656bfedcc96f7edc Prevent deletion from rooms we haven't left diff -r ffdfddd351b8 -r 887c1bd37617 mcabber/src/commands.c --- a/mcabber/src/commands.c Fri Nov 25 23:44:47 2005 +0100 +++ b/mcabber/src/commands.c Fri Nov 25 23:48:49 2005 +0100 @@ -544,6 +544,15 @@ jid = buddy_getjid(BUDDATA(current_buddy)); if (!jid) return; + if (buddy_gettype(BUDDATA(current_buddy)) & ROSTER_TYPE_ROOM) { + // This is a chatroom + // If there are resources, we haven't left + if (buddy_isresource(BUDDATA(current_buddy))) { + scr_LogPrint(LPRINT_NORMAL, "You haven't left this room!"); + return; + } + } + scr_LogPrint(LPRINT_LOGNORM, "Removing <%s>...", jid); jb_delbuddy(jid); }