summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--cmd/irc/main.go2
-rw-r--r--irc/states.go15
2 files changed, 17 insertions, 0 deletions
diff --git a/cmd/irc/main.go b/cmd/irc/main.go
index 7702e94..51a6b0a 100644
--- a/cmd/irc/main.go
+++ b/cmd/irc/main.go
@@ -229,6 +229,8 @@ func handleInput(s *irc.Session, buffer, content string) {
}
s.PrivMsg(buffer, args)
+ case "QUOTE":
+ s.SendRaw(args)
case "J", "JOIN":
s.Join(args)
case "PART":
diff --git a/irc/states.go b/irc/states.go
index c73e446..2b6f299 100644
--- a/irc/states.go
+++ b/irc/states.go
@@ -85,6 +85,10 @@ type Channel struct {
type action interface{}
type (
+ actionSendRaw struct {
+ raw string
+ }
+
actionJoin struct {
Channel string
}
@@ -220,6 +224,15 @@ func (s *Session) IsChannel(name string) bool {
return strings.IndexAny(name, "#&") == 0 // TODO compute CHANTYPES
}
+func (s *Session) SendRaw(raw string) {
+ s.acts <- actionSendRaw{raw}
+}
+
+func (s *Session) sendRaw(act actionSendRaw) (err error) {
+ err = s.send("%s\r\n", act.raw)
+ return
+}
+
func (s *Session) Join(channel string) {
s.acts <- actionJoin{channel}
}
@@ -304,6 +317,8 @@ func (s *Session) run() {
select {
case act := <-s.acts:
switch act := act.(type) {
+ case actionSendRaw:
+ err = s.sendRaw(act)
case actionJoin:
err = s.join(act)
case actionPart: