public virtual void Cleanup() { List <Item> items = this.Items; for (int i = items.Count - 1; i >= 0; --i) { if (i >= items.Count) { continue; } BulletinMessage msg = items[i] as BulletinMessage; if (msg == null) { continue; } if (msg.Thread == null && CheckTime(msg.LastPostTime, ThreadDeletionTime)) { msg.Delete(); RecurseDelete(msg); // A root-level thread has expired } } }
private void RecurseDelete(BulletinMessage msg) { List <Item> found = new List <Item>(); List <Item> items = this.Items; for (int i = items.Count - 1; i >= 0; --i) { if (i >= items.Count) { continue; } BulletinMessage check = items[i] as BulletinMessage; if (check == null) { continue; } if (check.Thread == msg) { check.Delete(); found.Add(check); } } for (int i = 0; i < found.Count; ++i) { RecurseDelete((BulletinMessage)found[i]); } }
public static void BBRemoveMessage(Mobile from, BaseBulletinBoard board, PacketReader pvSrc) { BulletinMessage msg = World.FindItem(pvSrc.ReadInt32()) as BulletinMessage; if (msg == null || msg.Parent != board) { return; } if (from.AccessLevel < AccessLevel.GameMaster && msg.Poster != from) { return; } msg.Delete(); }