+ if (!at && !excl) {
+ /* Neither "!" nor "@" found: use string as nickname */
+ strlcpy(mask, Pattern, len - 5);
+ strlcat(mask, "!*@*", len);
+ } else if (!at && excl) {
+ /* Domain part is missing */
+ strlcpy(mask, Pattern, len - 3);
+ strlcat(mask, "@*", len);
+ } else if (at && !excl) {
+ /* User name is missing */
+ *at = '\0'; at++;
+ strlcpy(mask, Pattern, len - 5);
+ strlcat(mask, "!*@", len);
+ strlcat(mask, at, len);
+ } else {
+ /* All parts (nick, user and domain name) are given */
+ strlcpy(mask, Pattern, len);
+ }
+} /* Lists_MakeMask */
+
+/**
+ * Check if a client is listed in a list.
+ *
+ * @param h List head.
+ * @param Client Client to check.
+ * @return true if client is listed, false if not.
+ */
+bool
+Lists_Check(struct list_head *h, CLIENT *Client)
+{
+ return Lists_CheckReason(h, Client, NULL, 0);
+}
+
+/**
+ * Check if a client is listed in a list and store the reason.
+ *
+ * @param h List head.
+ * @param Client Client to check.
+ * @param reason Buffer to store the reason.
+ * @param len Size of the buffer if reason should be saved.
+ * @return true if client is listed, false if not.
+ */
+bool
+Lists_CheckReason(struct list_head *h, CLIENT *Client, char *reason, size_t len)