security fix not taking messages from wrong channels anymore

This commit is contained in:
jenzuffer 2020-11-02 11:13:31 +01:00
parent 7b1f95bcd5
commit 10dee533d1
4 changed files with 6 additions and 3 deletions

View File

@ -58,12 +58,15 @@ public class DoStuff {
} }
List<User> blockLast = event.getMessage().getUserMentions().buffer().blockLast(); List<User> blockLast = event.getMessage().getUserMentions().buffer().blockLast();
String content = event.getMessage().getContent(); String content = event.getMessage().getContent();
if (!channelpermissionsDenied && blockLast != null) { if (!channelpermissionsDenied) {
if (blockLast != null)
{
for (User user : blockLast) { for (User user : blockLast) {
content = content.replace(user.getId().asString(), ""); content = content.replace(user.getId().asString(), "");
} }
}
MessageResponseHandler.getMessage(content);
} }
MessageResponseHandler.getMessage(content);
boolean mentionedBot = false; boolean mentionedBot = false;
if (blockLast != null){ if (blockLast != null){
for (User user : blockLast) for (User user : blockLast)

View File

@ -1,5 +1,5 @@
#Generated by Maven #Generated by Maven
#Mon Nov 02 09:03:03 CET 2020 #Mon Nov 02 11:08:19 CET 2020
version=1.0 version=1.0
groupId=com.mycompany groupId=com.mycompany
artifactId=ArtificialAutism artifactId=ArtificialAutism