]> Pileus Git - ~andy/spades/blobdiff - src/org/pileus/spades/Message.java
Add aliases or /j and /p
[~andy/spades] / src / org / pileus / spades / Message.java
index 68a78f0797cc0479edfca73893f7a8e87eb5fbc3..717677c35e3faddbefcc5f5ecf9ab8aafe8eb8e9 100644 (file)
@@ -37,12 +37,14 @@ public class Message
                public int     code;
                public String  hex;
                public String  name;
+               public int     color;
 
                public Color(int code, String hex, String name)
                {
                        this.code  = code;
                        this.hex   = hex;
                        this.name  = name;
+                       this.color = Os.getColor(hex);
                }
        };
 
@@ -211,7 +213,7 @@ public class Message
                String arg = notnull(mr.group(3));
 
                // Parse commands
-               if (cmd.matches("join")) {
+               if (cmd.matches("j(oin)?")) {
                        Os.debug("Message: /join");
                        this.type = Type.JOIN;
                        this.cmd  = "JOIN";
@@ -219,7 +221,7 @@ public class Message
                        this.line = this.cmd + " :" + arg;
                }
 
-               if (cmd.matches("part")) {
+               if (cmd.matches("p(art)?")) {
                        Os.debug("Message: /part");
                        this.type = Type.PART;
                        this.cmd  = "PART";