Added the ability to ignore nicknames.
This commit is contained in:
parent
85be0ce22b
commit
6755d959a1
5 changed files with 153 additions and 68 deletions
|
@ -1,3 +1,3 @@
|
|||
#ANT Task: ch.oscg.jreleaseinfo.BuildNumberHandler
|
||||
#Sat Oct 30 11:43:51 PDT 2004
|
||||
build.num.last=6
|
||||
#Sun Oct 31 00:44:26 PDT 2004
|
||||
build.num.last=7
|
||||
|
|
111
mobibot.iws
111
mobibot.iws
|
@ -115,16 +115,16 @@
|
|||
<first-group selected-file="file://$PROJECT_DIR$/src/net/thauvin/erik/mobibot/Mobibot.java">
|
||||
<entry file="file://$PROJECT_DIR$/src/net/thauvin/erik/mobibot/Mobibot.java" pinned="false">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="1035" column="65" selection-start="26542" selection-end="26542" vertical-scroll-proportion="0.14382403">
|
||||
<state line="1055" column="9" selection-start="27106" selection-end="27106" vertical-scroll-proportion="0.21319798">
|
||||
<folding>
|
||||
<element signature="imports" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/net/thauvin/erik/mobibot/Weather.java" pinned="false">
|
||||
<entry file="file://$PROJECT_DIR$/logs/2004-11-03.xml" pinned="false">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="59" column="38" selection-start="2170" selection-end="2182" vertical-scroll-proportion="0.3790186">
|
||||
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
|
@ -145,20 +145,21 @@
|
|||
<component name="J2EEProjectPane" />
|
||||
<component name="NamedScopeManager" />
|
||||
<component name="PackagesPane">
|
||||
<expanded_node url="net" module="mobibot" type="package" />
|
||||
<expanded_node url="net.thauvin.erik" module="mobibot" type="package" />
|
||||
<expanded_node url="net.thauvin" module="mobibot" type="package" />
|
||||
<expanded_node url="" module="mobibot" type="module" />
|
||||
<expanded_node url="net.thauvin.erik.mobibot" module="mobibot" type="package" />
|
||||
<expanded_node url="net.thauvin" module="mobibot" type="package" />
|
||||
<expanded_node url="net" module="mobibot" type="package" />
|
||||
<expanded_node url="" module="mobibot" type="module" />
|
||||
</component>
|
||||
<component name="ProjectPane">
|
||||
<expanded_node url="" module="mobibot" type="module" />
|
||||
<expanded_node url="file://$PROJECT_DIR$/logs" module="mobibot" type="directory" />
|
||||
<expanded_node url="file://$PROJECT_DIR$/lib" module="mobibot" type="directory" />
|
||||
<expanded_node url="file://$PROJECT_DIR$" module="mobibot" type="directory" />
|
||||
<expanded_node url="" module="mobibot" type="module" />
|
||||
<expanded_node url="file://$PROJECT_DIR$/website" module="mobibot" type="directory" />
|
||||
</component>
|
||||
<component name="ProjectView">
|
||||
<navigator currentView="PackagesPane" splitterProportion="0.5">
|
||||
<navigator currentView="ProjectPane" splitterProportion="0.5">
|
||||
<flattenPackages />
|
||||
<showMembers />
|
||||
<showModules />
|
||||
|
@ -229,20 +230,6 @@
|
|||
<option name="HOST" value="localhost" />
|
||||
<option name="PORT" value="5005" />
|
||||
</configuration>
|
||||
<configuration selected="false" default="true" type="WebLogic Instance" factoryName="Local">
|
||||
<option name="WORKING_DIRECTORY" />
|
||||
<option name="HOST" value="localhost" />
|
||||
<option name="PORT" value="7001" />
|
||||
<option name="LOCAL" value="true" />
|
||||
<option name="OPEN_IN_BROWSER" value="true" />
|
||||
<option name="OPEN_IN_BROWSER_URL" value="/" />
|
||||
<option name="COMMON_VM_ARGUMENTS" value="" />
|
||||
<option name="DOMAIN_PATH" value="" />
|
||||
<option name="USER" value="weblogic" />
|
||||
<option name="PASSWORD" value="weblogic" />
|
||||
<option name="SERVER_NAME" value="myserver" />
|
||||
<option name="DOMAIN_NAME" value="mydomain" />
|
||||
</configuration>
|
||||
<configuration selected="false" default="true" type="Application" factoryName="Application">
|
||||
<option name="MAIN_CLASS_NAME" />
|
||||
<option name="VM_PARAMETERS" />
|
||||
|
@ -260,10 +247,24 @@
|
|||
<option name="POLICY_FILE" value="C:/IntelliJ-IDEA/bin/appletviewer.policy" />
|
||||
<option name="VM_PARAMETERS" />
|
||||
</configuration>
|
||||
<configuration selected="false" default="true" type="WebLogic Instance" factoryName="Local">
|
||||
<option name="WORKING_DIRECTORY" />
|
||||
<option name="HOST" value="localhost" />
|
||||
<option name="PORT" value="7001" />
|
||||
<option name="LOCAL" value="true" />
|
||||
<option name="OPEN_IN_BROWSER" value="true" />
|
||||
<option name="OPEN_IN_BROWSER_URL" value="/" />
|
||||
<option name="COMMON_VM_ARGUMENTS" value="" />
|
||||
<option name="DOMAIN_PATH" value="" />
|
||||
<option name="USER" value="weblogic" />
|
||||
<option name="PASSWORD" value="weblogic" />
|
||||
<option name="SERVER_NAME" value="myserver" />
|
||||
<option name="DOMAIN_NAME" value="mydomain" />
|
||||
</configuration>
|
||||
<configuration selected="true" default="false" name="Mobibot" type="Application" factoryName="Application">
|
||||
<option name="MAIN_CLASS_NAME" value="net.thauvin.erik.mobibot.Mobibot" />
|
||||
<option name="VM_PARAMETERS" value="" />
|
||||
<option name="PROGRAM_PARAMETERS" value="-d -s mobibot2.ser" />
|
||||
<option name="PROGRAM_PARAMETERS" value="-d" />
|
||||
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
|
||||
<module name="mobibot" />
|
||||
<RunnerSettings RunnerId="Run" />
|
||||
|
@ -322,20 +323,20 @@
|
|||
</todo-panel>
|
||||
</component>
|
||||
<component name="ToolWindowManager">
|
||||
<frame x="-4" y="-4" width="1032" height="776" extended-state="6" />
|
||||
<editor active="false" />
|
||||
<frame x="-4" y="-4" width="1032" height="776" extended-state="0" />
|
||||
<editor active="true" />
|
||||
<layout>
|
||||
<window_info id="Properties File Structure" active="false" anchor="right" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.20918368" order="5" />
|
||||
<window_info id="CVS" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33024693" order="8" />
|
||||
<window_info id="Regex" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.44135803" order="10" x="22" y="277" width="980" height="214" />
|
||||
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33024693" order="7" />
|
||||
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.2622449" order="0" />
|
||||
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="docked" type="docked" visible="true" weight="0.2622449" order="0" />
|
||||
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33024693" order="1" />
|
||||
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.27959183" order="1" />
|
||||
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33024693" order="9" />
|
||||
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="true" internal_type="docked" type="docked" visible="false" weight="0.39969134" order="6" />
|
||||
<window_info id="Dependency Viewer" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33" order="8" />
|
||||
<window_info id="Ant Build" active="true" anchor="right" auto_hide="false" internal_type="docked" type="docked" visible="true" weight="0.13061224" order="1" />
|
||||
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="docked" type="docked" visible="true" weight="0.1244898" order="1" />
|
||||
<window_info id="Run" active="false" anchor="bottom" auto_hide="true" internal_type="docked" type="docked" visible="false" weight="0.39660493" order="2" x="22" y="277" width="980" height="213" />
|
||||
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.25" order="2" />
|
||||
<window_info id="CVS File View" active="false" anchor="right" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33" order="3" />
|
||||
|
@ -425,22 +426,6 @@
|
|||
</buildFile>
|
||||
</component>
|
||||
<component name="editorHistoryManager">
|
||||
<entry file="file://$PROJECT_DIR$/.cvsignore">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="5" column="18" selection-start="74" selection-end="74" vertical-scroll-proportion="0.15178572">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/net/thauvin/erik/mobibot/StockQuote.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="45" column="20" selection-start="1862" selection-end="1862" vertical-scroll-proportion="0.28764805">
|
||||
<folding>
|
||||
<element signature="imports" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/net/thauvin/erik/mobibot/FeedReader.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="101" column="51" selection-start="2966" selection-end="2966" vertical-scroll-proportion="0.8595601">
|
||||
|
@ -469,15 +454,6 @@
|
|||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/net/thauvin/erik/mobibot/CurrencyConverter.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="180" column="0" selection-start="5069" selection-end="5069" vertical-scroll-proportion="0.9348659">
|
||||
<folding>
|
||||
<element signature="imports" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/buildnum.properties">
|
||||
<provider selected="true" editor-type-id="properties">
|
||||
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-offset="0" key-parts-delimiter="'.'">
|
||||
|
@ -531,9 +507,9 @@
|
|||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/net/thauvin/erik/mobibot/Mobibot.java">
|
||||
<entry file="file://$PROJECT_DIR$/src/net/thauvin/erik/mobibot/StockQuote.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="1035" column="65" selection-start="26542" selection-end="26542" vertical-scroll-proportion="0.14382403">
|
||||
<state line="53" column="13" selection-start="2029" selection-end="2029" vertical-scroll-proportion="0.33333334">
|
||||
<folding>
|
||||
<element signature="imports" expanded="true" />
|
||||
</folding>
|
||||
|
@ -542,11 +518,36 @@
|
|||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/net/thauvin/erik/mobibot/Weather.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="59" column="38" selection-start="2170" selection-end="2182" vertical-scroll-proportion="0.3790186">
|
||||
<state line="54" column="13" selection-start="2059" selection-end="2059" vertical-scroll-proportion="0.33333334">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/net/thauvin/erik/mobibot/CurrencyConverter.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="63" column="13" selection-start="2150" selection-end="2150" vertical-scroll-proportion="-3.9424703">
|
||||
<folding>
|
||||
<element signature="imports" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/logs/2004-11-03.xml">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/net/thauvin/erik/mobibot/Mobibot.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="1055" column="9" selection-start="27106" selection-end="27106" vertical-scroll-proportion="0.21319798">
|
||||
<folding>
|
||||
<element signature="imports" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</component>
|
||||
<component name="ideajad">
|
||||
<property name="annotate" value="false" />
|
||||
|
|
|
@ -162,6 +162,16 @@ public class Mobibot extends PircBot
|
|||
*/
|
||||
private static final String CYCLE_CMD = "cycle";
|
||||
|
||||
/**
|
||||
* The ignore command.
|
||||
*/
|
||||
private static final String IGNORE_CMD = "ignore";
|
||||
|
||||
/**
|
||||
* The ignore <code>me</code> keyword.
|
||||
*/
|
||||
private static final String IGNORE_ME_KEYWORD = "me";
|
||||
|
||||
/**
|
||||
* The help command.
|
||||
*/
|
||||
|
@ -887,6 +897,14 @@ public class Mobibot extends PircBot
|
|||
send(sender, DOUBLE_INDENT + bold(getNick() + ": " + CURRENCY_CMD));
|
||||
}
|
||||
}
|
||||
else if (lcTopic.startsWith(IGNORE_CMD))
|
||||
{
|
||||
send(sender, "To check your ignore status:");
|
||||
send(sender, DOUBLE_INDENT + bold(getNick() + ": " + IGNORE_CMD));
|
||||
|
||||
send(sender, "To toggle your ignore status:");
|
||||
send(sender, DOUBLE_INDENT + bold(getNick() + ": " + IGNORE_CMD + ' ' + IGNORE_ME_KEYWORD));
|
||||
}
|
||||
else
|
||||
{
|
||||
send(sender, bold("Type a URL on " + getChannel() + " to post it."));
|
||||
|
@ -895,12 +913,13 @@ public class Mobibot extends PircBot
|
|||
send(sender, "The commands are:");
|
||||
send(sender,
|
||||
DOUBLE_INDENT +
|
||||
bold(CALC_CMD + ' ' + CURRENCY_CMD + ' ' + DICE_CMD + ' ' + GOOGLE_CMD + ' ' + INFO_CMD + ' ' +
|
||||
getChannel().substring(1) + ' ' + LOOKUP_CMD));
|
||||
bold(CALC_CMD + ' ' + CURRENCY_CMD + ' ' + DICE_CMD + ' ' + GOOGLE_CMD + ' ' + IGNORE_CMD));
|
||||
send(sender,
|
||||
DOUBLE_INDENT +
|
||||
bold(HELP_POSTING_KEYWORD + ' ' + RECAP_CMD + ' ' + SPELL_CMD + ' ' + STOCK_CMD + ' ' + TIME_CMD +
|
||||
' ' + USERS_CMD + ' ' + VIEW_CMD));
|
||||
bold(INFO_CMD + ' ' + getChannel().substring(1) + ' ' + LOOKUP_CMD + ' ' + HELP_POSTING_KEYWORD + ' ' +
|
||||
RECAP_CMD));
|
||||
send(sender,
|
||||
DOUBLE_INDENT + bold(SPELL_CMD + ' ' + STOCK_CMD + ' ' + TIME_CMD + ' ' + USERS_CMD + ' ' + VIEW_CMD));
|
||||
send(sender, DOUBLE_INDENT + bold(WEATHER_CMD));
|
||||
|
||||
if (isOp(sender))
|
||||
|
@ -1203,6 +1222,71 @@ public class Mobibot extends PircBot
|
|||
{
|
||||
weatherResponse(sender, args, false);
|
||||
}
|
||||
else if (cmd.startsWith(IGNORE_CMD))
|
||||
{
|
||||
if (!isOp(sender))
|
||||
{
|
||||
final String nick = sender.toLowerCase();
|
||||
final boolean isMe = args.toLowerCase().startsWith(IGNORE_ME_KEYWORD);
|
||||
|
||||
if (_ignoredNicks.contains(nick))
|
||||
{
|
||||
if (isMe)
|
||||
{
|
||||
_ignoredNicks.remove(nick);
|
||||
|
||||
send(sender, "You are no longer ignored.");
|
||||
}
|
||||
else
|
||||
{
|
||||
send(sender, "You are currently ignored.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isMe)
|
||||
{
|
||||
_ignoredNicks.add(nick);
|
||||
|
||||
send(sender, "You are now ignored.");
|
||||
}
|
||||
else
|
||||
{
|
||||
send(sender, "You are not currently ignored.");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (args.length() > 0)
|
||||
{
|
||||
final String[] nicks = args.toLowerCase().split(" ");
|
||||
|
||||
String nick;
|
||||
|
||||
for (int i = 0; i < nicks.length; i++)
|
||||
{
|
||||
nick = nicks[i];
|
||||
|
||||
if (IGNORE_ME_KEYWORD.equals(nick))
|
||||
{
|
||||
nick = sender.toLowerCase();
|
||||
}
|
||||
|
||||
if (_ignoredNicks.contains(nick))
|
||||
{
|
||||
_ignoredNicks.remove(nick);
|
||||
}
|
||||
else
|
||||
{
|
||||
_ignoredNicks.add(nick);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
send(sender, "The following nicks are ignored: " + _ignoredNicks.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (message.matches(LINK_CMD + "[0-9]+:.*"))
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Created by JReleaseInfo AntTask from Open Source Competence Group */
|
||||
/* Creation date Sat Oct 30 11:43:51 PDT 2004 */
|
||||
/* Creation date Sun Oct 31 00:44:26 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 1099161831468L). */
|
||||
private static Date buildDate = new Date(1099161831468L);
|
||||
/** buildDate (set during build process to 1099208666406L). */
|
||||
private static Date buildDate = new Date(1099208666406L);
|
||||
|
||||
/**
|
||||
* Get buildDate (set during build process to Sat Oct 30 11:43:51 PDT 2004).
|
||||
* Get buildDate (set during build process to Sun Oct 31 00:44:26 PDT 2004).
|
||||
* @return Date buildDate
|
||||
*/
|
||||
public static final Date getBuildDate() { return buildDate; }
|
||||
|
||||
|
||||
/**
|
||||
* Get buildNumber (set during build process to 6).
|
||||
* Get buildNumber (set during build process to 7).
|
||||
* @return int buildNumber
|
||||
*/
|
||||
public static final int getBuildNumber() { return 6; }
|
||||
public static final int getBuildNumber() { return 7; }
|
||||
|
||||
|
||||
/** version (set during build process to "0.2"). */
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
<li>Displaying weather information</li>
|
||||
</ul>
|
||||
<p>Some of the internal features include RSS feed backlogs, rolling logs, debugging toggle and much more.</p>
|
||||
<p>If you have any feature suggestions, please post them to the <a href="/wiki/space/mobibot/"><strong>mobibot wiki</strong></a>. </p>
|
||||
<p>If you have any feature suggestions, please post them to the <a href="/wiki/display/mobibot"><strong>mobibot wiki</strong></a>. </p>
|
||||
<h3>Using mobibot</h3>
|
||||
<p>To use mobibot, simply <strong>join <a href="irc://irc.freenode.net/#mobitopia">#mobitopia</a></strong> on <strong>irc.freenode.net</strong> and type:</p>
|
||||
<p><code>mobibot: help</code></p>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue