minor fixes
This commit is contained in:
parent
2058370ee6
commit
61a7b76096
5 changed files with 17 additions and 9 deletions
2
pom.xml
2
pom.xml
|
@ -4,7 +4,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>loper</groupId>
|
||||
<artifactId>InnaIrcBot</artifactId>
|
||||
<version>0.9.1-SNAPSHOT</version>
|
||||
<version>0.9.2-SNAPSHOT</version>
|
||||
|
||||
<packaging>jar</packaging>
|
||||
<name>InnaIrcBot</name>
|
||||
|
|
|
@ -288,7 +288,7 @@ public class PrivateMsgCommander { // TODO: add black list: add users afte
|
|||
private void unban(String chanel, String user){
|
||||
cmode(chanel, "-b", simplifyNick(user)+"*!*@*");
|
||||
if (user.contains("@")){
|
||||
cmode(chanel, "-b", "*!*@"+user.replaceAll("^.+@",""));
|
||||
cmode(chanel, "-b", user);
|
||||
}
|
||||
}
|
||||
private void kickban(String chanel, String user, String reason){
|
||||
|
|
|
@ -66,9 +66,8 @@ public class JoinFloodHandler implements EventHandler {
|
|||
return fistJoinTime;
|
||||
}
|
||||
private void kickBanUser(String user){
|
||||
StreamProvider.writeToStream(server,
|
||||
"PRIVMSG "+ channel +" :"+user+": join flood ("+ joinMaxNumber +" connections in "+timeFrameInSeconds+" seconds).\n"+
|
||||
"MODE "+ channel +" +b "+user+"!*@*"); // TODO: consider other ban methods
|
||||
StreamProvider.writeToStream(server,"PRIVMSG "+ channel +" :"+user+": join flood ("+ joinMaxNumber +" connections in "+timeFrameInSeconds+" seconds).\n");
|
||||
StreamProvider.writeToStream(server,"MODE "+ channel +" +b "+user+"!*@*"); // TODO: consider other ban methods
|
||||
}
|
||||
|
||||
private String simplifyNick(String nick){ return nick.replaceAll("!.*$",""); }
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package InnaIrcBot;
|
||||
|
||||
public class GlobalData {
|
||||
private static final String version = "InnaIrcBot v0.9.1 \"Литке\"";
|
||||
private static final String version = "InnaIrcBot v0.9.2 \"Литке\"";
|
||||
public static synchronized String getAppVersion(){
|
||||
return String.format("%s, %s %s %s", version,
|
||||
System.getProperty("os.name"),
|
||||
|
|
|
@ -70,12 +70,21 @@ class LinksTitleHandler implements Runnable{
|
|||
);
|
||||
|
||||
StringBuilder stringBuffer = new StringBuilder();
|
||||
//stringBuffer.setLength();
|
||||
String line;
|
||||
int semaphore = 0;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
if (semaphore == 1) {
|
||||
stringBuffer.append(line);
|
||||
if (line.contains("</title>")) {
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (line.contains("<title>")) {
|
||||
semaphore = 1;
|
||||
stringBuffer.append(line);
|
||||
}
|
||||
}
|
||||
reader.close();
|
||||
connection.disconnect();
|
||||
|
|
Loading…
Reference in a new issue