From e3cbc4e80832b528d300d3640b53ffd825d30431 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Tue, 31 Mar 2020 22:36:18 -0700 Subject: [PATCH] Cleanup. --- src/main/java/net/thauvin/erik/mobibot/FeedReader.java | 2 +- src/main/java/net/thauvin/erik/mobibot/commands/Ignore.kt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/thauvin/erik/mobibot/FeedReader.java b/src/main/java/net/thauvin/erik/mobibot/FeedReader.java index 9188758..d140105 100644 --- a/src/main/java/net/thauvin/erik/mobibot/FeedReader.java +++ b/src/main/java/net/thauvin/erik/mobibot/FeedReader.java @@ -83,11 +83,11 @@ class FeedReader implements Runnable { final SyndFeedInput input = new SyndFeedInput(); final SyndFeed feed = input.build(new XmlReader(new URL(url))); - SyndEntry item; final List items = feed.getEntries(); if (items.isEmpty()) { bot.send(sender, "There is currently nothing to view. Why don't you post something?", false); } else { + SyndEntry item; for (int i = 0; (i < items.size()) && (i < MAX_ITEMS); i++) { item = items.get(i); bot.send(sender, item.getTitle(), false); diff --git a/src/main/java/net/thauvin/erik/mobibot/commands/Ignore.kt b/src/main/java/net/thauvin/erik/mobibot/commands/Ignore.kt index 3138b70..ffc42a0 100644 --- a/src/main/java/net/thauvin/erik/mobibot/commands/Ignore.kt +++ b/src/main/java/net/thauvin/erik/mobibot/commands/Ignore.kt @@ -34,6 +34,7 @@ package net.thauvin.erik.mobibot.commands import net.thauvin.erik.mobibot.Mobibot import net.thauvin.erik.mobibot.Utils +import net.thauvin.erik.mobibot.commands.links.UrlMgr import java.util.* class Ignore(defaultIgnore: String) : AbstractCommand() { @@ -41,7 +42,7 @@ class Ignore(defaultIgnore: String) : AbstractCommand() { init { if (defaultIgnore.isNotBlank()) { - ignored.addAll(defaultIgnore.split(", *| +".toRegex())) + ignored.addAll(defaultIgnore.split(UrlMgr.LINK_MATCH.toRegex())) } }