Skip to content

Commit

Permalink
Merge pull request #153 from SOBotics/bugfix/134-reporting-twice
Browse files Browse the repository at this point in the history
Rolled back that function to 7c8db98, which was the working version.
  • Loading branch information
FelixSFD authored Feb 14, 2018
2 parents f20f8ab + 559a4e4 commit 95646e5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ In [this file](feedback.md), we collected information on how we react to Guttenb

## Accuracy

We are aleady collecting data with [CopyPastor](https://github.com/SOBotics/CopyPastor) to provide statisctics, but since there are not that many posts to report, it will take a while until we have enough data.
We are already collecting data with [CopyPastor](https://github.com/SOBotics/CopyPastor) to provide statisctics, but since there are not that many posts to report, it will take a while until we have enough data.


[1]: http://chat.stackoverflow.com/rooms/111347/sobotics
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>de.felixsfd.stackoverflow</groupId>
<artifactId>guttenberg</artifactId>
<version>1.0.1</version>
<version>1.0.2</version>

<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,22 @@ public void mention(Room room, PingMessageEvent event, boolean isReply, RunnerSe
for (SpecialCommand command : commands) {
if (command.validate()) {
boolean standbyMode = PingService.standby.get();
if (command instanceof CheckUser){
User user = event.getUser().get();
if (!user.isModerator() && !user.isRoomOwner()){
room.replyTo(message.getId(), "This command can only be executed by RO or moderator");
return;

if (standbyMode == true) {
if (command.availableInStandby() == true) {
command.execute(room, instance);
}
}
if (standbyMode && command.availableInStandby()) {
command.execute(room, instance);
} else {
if (command instanceof CheckUser){
User user = event.getUser().get();
if (!user.isModerator() && !user.isRoomOwner()){
room.replyTo(message.getId(), "This command can only be executed by RO or moderator");
return;
}
}
// Ideally this should be implemented in the validate method of the checkuser command.
command.execute(room, instance);
}
//maybe return?, is the idea that multiple commands can match?
}
}
}
Expand Down

0 comments on commit 95646e5

Please sign in to comment.