v0.2.2 minor changes: add tracking /me in PrivateMsgCommander command tell

This commit is contained in:
Dmitry Isaenko 2019-01-09 14:31:40 +03:00
parent 23a8b35d1e
commit 79b13c9126
4 changed files with 7 additions and 4 deletions

View file

@ -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.2.1-SNAPSHOT</version> <version>0.2.2-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>InnaIrcBot</name> <name>InnaIrcBot</name>

View file

@ -27,7 +27,7 @@ public class PrivateMsgCommander { // T
case "tell": case "tell":
if ((cmd.length == 2) && (cmd[1].split("(\\s)|(\t)+?",2).length == 2)) { if ((cmd.length == 2) && (cmd[1].split("(\\s)|(\t)+?",2).length == 2)) {
String[] tellArgs = cmd[1].split("(\\s)|(\t)+?", 2); String[] tellArgs = cmd[1].split("(\\s)|(\t)+?", 2);
tell(tellArgs[0], tellArgs[1].trim()); tell(tellArgs[0], tellArgs[1]);
} }
else else
tell(simplifyNick(sender), "Pattern: tell <nick> <message>"); tell(simplifyNick(sender), "Pattern: tell <nick> <message>");
@ -241,6 +241,10 @@ public class PrivateMsgCommander { // T
//System.exit(0); // TODO: change to normal exit //System.exit(0); // TODO: change to normal exit
} }
private void tell(String channelUser, String message){ private void tell(String channelUser, String message){
message = message.trim();
if (message.startsWith("/me ")){
message = "\u0001ACTION "+message.substring(3)+"\u0001";
}
raw("PRIVMSG "+channelUser+" :"+message); raw("PRIVMSG "+channelUser+" :"+message);
} }
private void nick(String newNick){ private void nick(String newNick){

View file

@ -1,7 +1,7 @@
package InnaIrcBot; package InnaIrcBot;
public class GlobalData { public class GlobalData {
public static final String version = "InnaIrcBot v0.2.1 \"Маньчжурия\""; public static final String version = "InnaIrcBot v0.2.2 \"Маньчжурия\"";
public static synchronized String getAppVersion(){ public static synchronized String getAppVersion(){
return version; return version;
} }

View file

@ -1,7 +1,6 @@
package Temporary; package Temporary;
import InnaIrcBot.ReconnectControl; import InnaIrcBot.ReconnectControl;
import com.sun.org.apache.regexp.internal.RE;
public class ReconnectControlTest { public class ReconnectControlTest {
public static void main(String args[]){ public static void main(String args[]){