Removed redundant configuration values and made use of customizable join/quit messages.

This commit is contained in:
FrozenCow 2011-04-05 22:30:43 +02:00
parent d4a2d2d32f
commit e1e13df4b2
5 changed files with 14 additions and 26 deletions

View file

@ -67,21 +67,9 @@ public class SendMessageHandler implements HttpHandler {
disallowedUsers.put(user.name, user);
disallowedUserQueue.add(user);
} else {
spamMessage = spamMessage.replaceAll("%interval%", Integer.toString(maximumMessageInterval/1000));
byte[] stringBytes = spamMessage.getBytes();
String dateStr = new Date().toString();
response.fields.put("Date", dateStr);
response.fields.put("Content-Type", "text/plain");
response.fields.put("Expires", "Thu, 01 Dec 1994 16:00:00 GMT");
response.fields.put("Last-modified", dateStr);
response.fields.put("Content-Length", Integer.toString(stringBytes.length));
response.status = HttpStatus.OK;
BufferedOutputStream out = null;
out = new BufferedOutputStream(response.getBody());
out.write(stringBytes);
out.flush();
response.fields.put("Content-Length", "0");
response.status = HttpStatus.Forbidden;
response.getBody();
return;
}
}