+
+ if (msg.charAt(0) == '/') {
+ if (ptCmd == null)
+ ptCmd = Pattern.compile(reCmd);
+ Matcher mr = ptCmd.matcher(msg);
+ if (!mr.matches())
+ return;
+
+ String cmd = notnull(mr.group(1));
+ String arg = notnull(mr.group(3));
+
+ if (cmd.matches("join")) {
+ Os.debug("Message: /join");
+ this.type = Type.JOIN;
+ this.cmd = "JOIN";
+ this.msg = arg;
+ this.line = this.cmd + " :" + arg;
+ }
+ if (cmd.matches("part")) {
+ Os.debug("Message: /part");
+ this.type = Type.PART;
+ this.cmd = "PART";
+ this.msg = arg;
+ this.line = this.cmd + " :" + arg;
+ }
+ if (this.line == null) {
+ Os.debug("Message: unknown command");
+ }
+ } else {
+ this.type = Type.PRIVMSG;
+ this.cmd = "PRIVMSG";
+ this.dst = dst;
+ this.msg = msg;
+ this.line = this.cmd + " " + this.dst + " :" + this.msg;
+ }