Fixed else caught. Improved isValid.

This commit is contained in:
Christian P. MOMON 2017-12-26 02:16:40 +01:00
parent f983bc3f74
commit 2ca03e358d
4 changed files with 22 additions and 13 deletions

View File

@ -242,6 +242,7 @@ public class Hebdobot extends PircBot
{
String date = ISODateTimeFormat.basicDate().print(new DateTime());
String textReview = this.review.toString();
if (this.pastebinSettings.isValid())
{
logger.info("Pastebin the review.");
@ -394,15 +395,7 @@ public class Hebdobot extends PircBot
{
logger.info("% caught.");
// Topic message.
if (this.review == null)
{
sendMessage("Pas de revue en cours.");
}
else
{
this.review.add(new Message(sender, text));
}
// Ignore.
}
else if (text.startsWith("!"))
{
@ -415,12 +408,27 @@ public class Hebdobot extends PircBot
{
logger.info("Else caught.");
// Topic message.
if (this.review == null)
{
sendMessage("Pas de revue en cours.");
}
else
{
this.review.add(new Message(sender, text));
}
}
/*
else
{
logger.info("Else caught.");
// All the other.
if (this.review != null)
{
this.review.addRaw(new Message(sender, text));
}
}
}*/
}
}

View File

@ -60,7 +60,7 @@ public class PastebinSettings
{
boolean result;
if (StringUtils.isBlank(this.apiKey))
if ((StringUtils.isBlank(this.apiKey)) || (StringUtils.containsOnly(this.apiKey, 'X')))
{
result = false;
}

View File

@ -184,7 +184,7 @@ public class Review
{
String result;
final StringBuffer buffer = new StringBuffer();
StringBuffer buffer = new StringBuffer();
addLine(buffer, '=');
addCenter(buffer, "Revue de la semaine en cours");
addEmpty(buffer);

View File

@ -73,7 +73,8 @@ public class TwitterSettings
{
boolean result;
if ((StringUtils.isBlank(this.consumerKey)) || (StringUtils.isBlank(this.consumerSecret)))
if ((StringUtils.isBlank(this.consumerKey)) || (StringUtils.isBlank(this.consumerSecret)) || (StringUtils.containsOnly(this.consumerKey, 'X'))
|| (StringUtils.containsOnly(this.consumerSecret, 'X')))
{
result = false;
}