aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd_cap.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/cmd_cap.go b/cmd_cap.go
new file mode 100644
index 0000000..45aaacc
--- /dev/null
+++ b/cmd_cap.go
@@ -0,0 +1,22 @@
+package main
+
+import (
+ "strings"
+)
+
+func init() {
+ commandHandlers["CAP"] = handleClientCap
+}
+
+func handleClientCap(msg RMsg, client *Client) bool {
+ if len(msg.Params) < 1 {
+ client.Send(MakeMsg(self, ERR_NEEDMOREPARAMS, "CAP", "Not enough parameters"))
+ return true
+ }
+ switch (strings.ToUpper(msg.Params[0])) {
+ case "LS":
+ client.Send(MakeMsg(self, "CAP", client.Nick, "LS", "sasl=PLAIN,EXTERNAL"))
+ case "REQ":
+ }
+ return true
+}