Fixed else caught. Improved isValid.
This commit is contained in:
parent
f983bc3f74
commit
2ca03e358d
@ -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));
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user