/*
 * Copyright (c) 2018, Magic fTail
 * Copyright (c) 2019, osrs-music-map <osrs-music-map@users.noreply.github.com>
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice, this
 *    list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright notice,
 *    this list of conditions and the following disclaimer in the documentation
 *    and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
package net.runelite.client.plugins.chatfilter;

import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;

@ConfigGroup("chatfilter")
public interface ChatFilterConfig extends Config
{
	@ConfigItem(
		keyName = "filterType",
		name = "Filter type",
		description = "Configures how the messages are filtered",
		position = 1
	)
	default ChatFilterType filterType()
	{
		return ChatFilterType.CENSOR_WORDS;
	}

	@ConfigItem(
		keyName = "filteredWords",
		name = "Filtered Words",
		description = "List of filtered words, separated by commas",
		position = 2
	)
	default String filteredWords()
	{
		return "";
	}

	@ConfigItem(
		keyName = "filteredRegex",
		name = "Filtered Regex",
		description = "List of regular expressions to filter, one per line",
		position = 3
	)
	default String filteredRegex()
	{
		return "";
	}

	@ConfigItem(
		keyName = "filteredNames",
		name = "Filtered Names",
		description = "List of filtered names, one per line. Accepts regular expressions",
		position = 4
	)
	default String filteredNames()
	{
		return "";
	}

	@ConfigItem(
		keyName = "filterFriends",
		name = "Filter Friends",
		description = "Filter your friends' messages",
		position = 5
	)
	default boolean filterFriends()
	{
		return false;
	}

	@ConfigItem(
		keyName = "filterClan",
		name = "Filter Friends Chat Members",
		description = "Filter your friends chat members' messages",
		position = 6
	)
	default boolean filterFriendsChat()
	{
		return false;
	}

	@ConfigItem(
		keyName = "filterLogin",
		name = "Filter Logged In/Out Messages",
		description = "Filter your private chat to remove logged in/out messages",
		position = 7
	)
	default boolean filterLogin()
	{
		return false;
	}

	@ConfigItem(
		keyName = "collapseGameChat",
		name = "Collapse Game Chat",
		description = "Collapse duplicate game chat messages into a single line",
		position = 9
	)
	default boolean collapseGameChat()
	{
		return false;
	}

	@ConfigItem(
		keyName = "collapsePlayerChat",
		name = "Collapse Player Chat",
		description = "Collapse duplicate player chat messages into a single line",
		position = 10
	)
	default boolean collapsePlayerChat()
	{
		return false;
	}

	@ConfigItem(
		keyName = "maxRepeatedPublicChats",
		name = "Max repeated public chats",
		description = "Block player chat message if repeated this many times. 0 is off",
		position = 11
	)
	default int maxRepeatedPublicChats()
	{
		return 0;
	}
}

@@ -1623,16 +1623,65 @@
 figItem;
+%0Aimport net.runelite.client.config.ConfigSection;
 %0A%0A@Confi
@@ -1764,39 +1764,16 @@
 nfig
-Item(%0A%09%09keyName = %22filterType%22,
+Section(
 %0A%09%09n
@@ -1790,12 +1790,13 @@
 ter 
-type
+Lists
 %22,%0A%09
@@ -1816,45 +1816,46 @@
 = %22C
-onfigures how the messages ar
+ustom Word, Regex, and Usernam
 e filter
 ed%22,
@@ -1850,18 +1850,22 @@
 e filter
-ed
+ lists
 %22,%0A%09%09pos
@@ -1876,93 +1876,75 @@
 n = 
-1%0A%09)%0A%09default ChatFilterType filterType()%0A%09%7B%0A%09%09return ChatFilterType.CENSOR_WORDS;%0A%09%7D
+0,%0A%09%09closedByDefault = true%0A%09)%0A%09String filterLists = %22filterLists%22;
 %0A%0A%09@
@@ -2087,17 +2087,42 @@
 ition = 
-2
+1,%0A%09%09section = filterLists
 %0A%09)%0A%09def
@@ -2327,9 +2327,34 @@
 n = 
-3
+2,%0A%09%09section = filterLists
 %0A%09)%0A
@@ -2577,9 +2577,34 @@
 n = 
-4
+3,%0A%09%09section = filterLists
 %0A%09)%0A
@@ -2647,32 +2647,256 @@
 %09return %22%22;%0A%09%7D%0A%0A
+%09@ConfigItem(%0A%09%09keyName = %22filterType%22,%0A%09%09name = %22Filter type%22,%0A%09%09description = %22Configures how the messages are filtered%22,%0A%09%09position = 4%0A%09)%0A%09default ChatFilterType filterType()%0A%09%7B%0A%09%09return ChatFilterType.CENSOR_WORDS;%0A%09%7D%0A%0A
 %09@ConfigItem(%0A%09%09

Add config section for filter lists (#11900)