Merge branch 'master' of /home/erik/projects/github/java/mobibot
This commit is contained in:
commit
3f0c9102cd
5 changed files with 35 additions and 8 deletions
|
@ -13,8 +13,8 @@ import java.util.Date;
|
|||
* Annotation Processor</a>
|
||||
*/
|
||||
public final class ReleaseInfo {
|
||||
private final static String buildmeta = "002";
|
||||
private final static Date date = new Date(1467518031071L);
|
||||
private final static String buildmeta = "004";
|
||||
private final static Date date = new Date(1467595869139L);
|
||||
private final static int major = 0;
|
||||
private final static int minor = 7;
|
||||
private final static int patch = 0;
|
||||
|
|
|
@ -1117,7 +1117,14 @@ public class Mobibot extends PircBot
|
|||
{
|
||||
for (final String info : INFO_STRS)
|
||||
{
|
||||
send(sender, info, isPrivate);
|
||||
if (info.startsWith("http://"))
|
||||
{
|
||||
send(sender, Utils.green(info), isPrivate);
|
||||
}
|
||||
else
|
||||
{
|
||||
send(sender, info, isPrivate);
|
||||
}
|
||||
}
|
||||
|
||||
long timeInSeconds = (System.currentTimeMillis() - START_TIME) / 1000L;
|
||||
|
@ -1131,7 +1138,8 @@ public class Mobibot extends PircBot
|
|||
final long minutes = timeInSeconds / 60L;
|
||||
|
||||
send(sender,
|
||||
"Uptime: " + days + " day(s) " + hours + " hour(s) " + minutes + " minute(s) [Entries: " + entries.size()
|
||||
"Uptime: " + days + Utils.plural(days, " day ", " days ") + hours + Utils.plural(hours, " hour ", " hours ")
|
||||
+ minutes + Utils.plural(minutes, " minute ", " minutes ") + "[Entries: " + entries.size()
|
||||
+ (tell.isEnabled() && isOp(sender) ? ", Messages: " + tell.size() : "") + ']',
|
||||
isPrivate);
|
||||
}
|
||||
|
|
|
@ -216,7 +216,7 @@ public class Tell
|
|||
bot.send(sender,
|
||||
bot.helpIndent(bot.getNick() + ": " + TELL_CMD + ' ' + TELL_DEL_KEYWORD + " <id|"
|
||||
+ TELL_ALL_KEYWORD + '>'));
|
||||
bot.send(sender, "Messages are kept for " + Utils.bold(maxDays) + " days.");
|
||||
bot.send(sender, "Messages are kept for " + Utils.bold(maxDays) + Utils.plural(maxDays, " day.", " days."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -336,7 +336,7 @@ public class Tell
|
|||
bot.send(sender, "To view queued and sent messages:");
|
||||
bot.send(sender, bot.helpIndent(bot.getNick() + ": " + TELL_CMD + ' ' + Commands.VIEW_CMD));
|
||||
|
||||
bot.send(sender, "Messages are kept for " + Utils.bold(maxDays) + " days.");
|
||||
bot.send(sender, "Messages are kept for " + Utils.bold(maxDays) + Utils.plural(maxDays, " day.", " days."));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -309,6 +309,25 @@ final public class Utils
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the plural form of a word, if count > 1.
|
||||
*
|
||||
* @param count The count.
|
||||
* @param word The word.
|
||||
* @param plural The plural word.
|
||||
*/
|
||||
public static String plural(final long count, final String word, final String plural)
|
||||
{
|
||||
if (count > 1)
|
||||
{
|
||||
return plural;
|
||||
}
|
||||
else
|
||||
{
|
||||
return word;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes the given string reverse color.
|
||||
*
|
||||
|
|
|
@ -5,4 +5,4 @@ version.major=0
|
|||
version.minor=7
|
||||
version.patch=0
|
||||
version.prerelease=beta
|
||||
version.buildmeta=002
|
||||
version.buildmeta=004
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue