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>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>loper</groupId>
|
<groupId>loper</groupId>
|
||||||
<artifactId>InnaIrcBot</artifactId>
|
<artifactId>InnaIrcBot</artifactId>
|
||||||
<version>0.9.1-SNAPSHOT</version>
|
<version>0.9.2-SNAPSHOT</version>
|
||||||
|
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<name>InnaIrcBot</name>
|
<name>InnaIrcBot</name>
|
||||||
|
|
|
@ -288,7 +288,7 @@ public class PrivateMsgCommander { // TODO: add black list: add users afte
|
||||||
private void unban(String chanel, String user){
|
private void unban(String chanel, String user){
|
||||||
cmode(chanel, "-b", simplifyNick(user)+"*!*@*");
|
cmode(chanel, "-b", simplifyNick(user)+"*!*@*");
|
||||||
if (user.contains("@")){
|
if (user.contains("@")){
|
||||||
cmode(chanel, "-b", "*!*@"+user.replaceAll("^.+@",""));
|
cmode(chanel, "-b", user);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void kickban(String chanel, String user, String reason){
|
private void kickban(String chanel, String user, String reason){
|
||||||
|
|
|
@ -66,9 +66,8 @@ public class JoinFloodHandler implements EventHandler {
|
||||||
return fistJoinTime;
|
return fistJoinTime;
|
||||||
}
|
}
|
||||||
private void kickBanUser(String user){
|
private void kickBanUser(String user){
|
||||||
StreamProvider.writeToStream(server,
|
StreamProvider.writeToStream(server,"PRIVMSG "+ channel +" :"+user+": join flood ("+ joinMaxNumber +" connections in "+timeFrameInSeconds+" seconds).\n");
|
||||||
"PRIVMSG "+ channel +" :"+user+": join flood ("+ joinMaxNumber +" connections in "+timeFrameInSeconds+" seconds).\n"+
|
StreamProvider.writeToStream(server,"MODE "+ channel +" +b "+user+"!*@*"); // TODO: consider other ban methods
|
||||||
"MODE "+ channel +" +b "+user+"!*@*"); // TODO: consider other ban methods
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private String simplifyNick(String nick){ return nick.replaceAll("!.*$",""); }
|
private String simplifyNick(String nick){ return nick.replaceAll("!.*$",""); }
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package InnaIrcBot;
|
package InnaIrcBot;
|
||||||
|
|
||||||
public class GlobalData {
|
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(){
|
public static synchronized String getAppVersion(){
|
||||||
return String.format("%s, %s %s %s", version,
|
return String.format("%s, %s %s %s", version,
|
||||||
System.getProperty("os.name"),
|
System.getProperty("os.name"),
|
||||||
|
|
|
@ -70,12 +70,21 @@ class LinksTitleHandler implements Runnable{
|
||||||
);
|
);
|
||||||
|
|
||||||
StringBuilder stringBuffer = new StringBuilder();
|
StringBuilder stringBuffer = new StringBuilder();
|
||||||
|
//stringBuffer.setLength();
|
||||||
String line;
|
String line;
|
||||||
|
int semaphore = 0;
|
||||||
while ((line = reader.readLine()) != null) {
|
while ((line = reader.readLine()) != null) {
|
||||||
|
if (semaphore == 1) {
|
||||||
stringBuffer.append(line);
|
stringBuffer.append(line);
|
||||||
if (line.contains("</title>")) {
|
if (line.contains("</title>")) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (line.contains("<title>")) {
|
||||||
|
semaphore = 1;
|
||||||
|
stringBuffer.append(line);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
reader.close();
|
reader.close();
|
||||||
connection.disconnect();
|
connection.disconnect();
|
||||||
|
|
Loading…
Reference in a new issue