- int status;
- struct qelem *local, *member_of;
- char *name = list_info[L_NAME];
- member_of = NULL;
-
- /*
- * Attempt delete. - will only work if:
- * 1) This list has no members.
- * 2) This list in a member of no other lists.
- * 3) This list is not an ace of another object.
- */
-
- switch (status = sms_query("delete_list", 1, &name,
- Scream, (char *) NULL)) {
- case SMS_SUCCESS:
- Put_message("List Sucessfully Deleted.");
- CheckAce(list_info[L_ACE_TYPE], list_info[L_ACE_NAME], ask_first);
+ int status;
+ struct mqelem *local, *member_of;
+ char *name = list_info[L_NAME];
+ member_of = NULL;
+
+ /*
+ * Attempt delete. - will only work if:
+ * 1) This list has no members.
+ * 2) This list in a member of no other lists.
+ * 3) This list is not an ace of another object.
+ */
+
+ switch ((status = do_mr_query("delete_list", 1, &name, NULL, NULL)))
+ {
+ case MR_SUCCESS:
+ Put_message("List Sucessfully Deleted.");
+ CheckAce(list_info[L_ACE_TYPE], list_info[L_ACE_NAME], ask_first);
+ break;
+ case MR_IN_USE:
+ /*
+ * This list is in use. Try to find out why,
+ * and for the cases where we have a good idea of
+ * what to do we will query and then do it.
+ */
+
+ if ((CheckIfAce(name, "list", ask_first) != SUB_NORMAL) ||
+ (RemoveItemFromLists(name, "list",
+ &member_of, ask_first) != SUB_NORMAL))