-
+
diff --git a/src/net/thauvin/erik/mobibot/Mobibot.java b/src/net/thauvin/erik/mobibot/Mobibot.java
index 69cb58b..1c9b576 100644
--- a/src/net/thauvin/erik/mobibot/Mobibot.java
+++ b/src/net/thauvin/erik/mobibot/Mobibot.java
@@ -405,6 +405,11 @@ public class Mobibot extends PircBot
*/
private final Vector _history = new Vector(0);
+ /**
+ * The ignored nicks array.
+ */
+ private final Vector _ignoredNicks = new Vector(0);
+
/**
* The backlogs URL.
*/
@@ -618,6 +623,7 @@ public class Mobibot extends PircBot
final String feedURL = p.getProperty("feed", "");
final String backlogsURL = ensureDir(p.getProperty("backlogs", weblogURL), true);
final String googleKey = p.getProperty("google", "");
+ final String ignoredNicks = p.getProperty("ignore", "");
// Create the bot
final Mobibot bot = new Mobibot(server, channel, logsDir);
@@ -638,6 +644,9 @@ public class Mobibot extends PircBot
// Set the Google key
bot.setGoogleKey(googleKey);
+ // Set the ignored nicks
+ bot.setIgnoredNicks(ignoredNicks);
+
// Save the entries
bot.saveEntries(true);
@@ -1024,7 +1033,7 @@ public class Mobibot extends PircBot
_logger.debug(">>> " + sender + ": " + message);
}
- if (message.matches(LINK_MATCH))
+ if (message.matches(LINK_MATCH) && !isIgnoredNick(sender))
{
final String[] cmds = message.split(" ", 2);
final String cmd = cmds[0].trim();
@@ -1528,6 +1537,24 @@ public class Mobibot extends PircBot
_googleKey = googleKey;
}
+ /**
+ * Sets the Ignored nicks.
+ *
+ * @param nicks The nicks to ignore
+ */
+ private void setIgnoredNicks(String nicks)
+ {
+ if (isValidString(nicks))
+ {
+ final StringTokenizer st = new StringTokenizer(nicks, ",");
+
+ while (st.hasMoreTokens())
+ {
+ _ignoredNicks.add(st.nextToken().trim().toLowerCase());
+ }
+ }
+ }
+
/**
* Set today's date.
*
@@ -1974,7 +2001,7 @@ public class Mobibot extends PircBot
*
* @param isDayBackup Set the true if the daily backup file should also be created.
*/
- private synchronized void saveEntries(boolean isDayBackup)
+ private void saveEntries(boolean isDayBackup)
{
if (_logger.isDebugEnabled())
{
@@ -2309,6 +2336,23 @@ public class Mobibot extends PircBot
return ISO_SDF.format(Calendar.getInstance().getTime());
}
+ /**
+ * Determines whether the specified nick should be ignored.
+ *
+ * @param nick The nick.
+ *
+ * @return true
if the nick should be ignored, false
otherwise.
+ */
+ private boolean isIgnoredNick(String nick)
+ {
+ if (isValidString(nick))
+ {
+ return _ignoredNicks.contains(nick.toLowerCase());
+ }
+
+ return false;
+ }
+
/**
* Returns the bot's nickname regexp pattern.
*
diff --git a/src/net/thauvin/erik/mobibot/ReleaseInfo.java b/src/net/thauvin/erik/mobibot/ReleaseInfo.java
index 9bc1367..1241450 100644
--- a/src/net/thauvin/erik/mobibot/ReleaseInfo.java
+++ b/src/net/thauvin/erik/mobibot/ReleaseInfo.java
@@ -1,5 +1,5 @@
/* Created by JReleaseInfo AntTask from Open Source Competence Group */
-/* Creation date Mon Oct 04 07:18:37 PDT 2004 */
+/* Creation date Sat Oct 30 11:43:51 PDT 2004 */
package net.thauvin.erik.mobibot;
import java.util.Date;
@@ -12,21 +12,21 @@ import java.util.Date;
public class ReleaseInfo {
- /** buildDate (set during build process to 1096899517937L). */
- private static Date buildDate = new Date(1096899517937L);
+ /** buildDate (set during build process to 1099161831468L). */
+ private static Date buildDate = new Date(1099161831468L);
/**
- * Get buildDate (set during build process to Mon Oct 04 07:18:37 PDT 2004).
+ * Get buildDate (set during build process to Sat Oct 30 11:43:51 PDT 2004).
* @return Date buildDate
*/
public static final Date getBuildDate() { return buildDate; }
/**
- * Get buildNumber (set during build process to 3).
+ * Get buildNumber (set during build process to 6).
* @return int buildNumber
*/
- public static final int getBuildNumber() { return 3; }
+ public static final int getBuildNumber() { return 6; }
/** version (set during build process to "0.2"). */
diff --git a/website/index.html b/website/index.html
index 95eb61f..34d6872 100644
--- a/website/index.html
+++ b/website/index.html
@@ -42,7 +42,7 @@
Displaying weather information
Some of the internal features include RSS feed backlogs, rolling logs, debugging toggle and much more.
- If you have any feature suggestions, please post them to the mobibot wiki.
+ If you have any feature suggestions, please post them to the mobibot wiki.
Using mobibot
To use mobibot, simply join #mobitopia on irc.freenode.net and type:
mobibot: help