summaryrefslogtreecommitdiff
path: root/rooms.go
diff options
context:
space:
mode:
Diffstat (limited to 'rooms.go')
-rw-r--r--rooms.go28
1 files changed, 0 insertions, 28 deletions
diff --git a/rooms.go b/rooms.go
index 4aa8542..6a5accd 100644
--- a/rooms.go
+++ b/rooms.go
@@ -1,37 +1,9 @@
package main
import (
- "encoding/json"
"errors"
)
-type MsgType int
-
-const (
- MsgChat MsgType = iota // Default
- MsgJoin
- MsgLeave
-)
-
-func (mt *MsgType) MarshalJSON() ([]byte, error) {
- switch *mt {
- case MsgChat:
- return json.Marshal("chat")
- case MsgJoin:
- return json.Marshal("join")
- case MsgLeave:
- return json.Marshal("leave")
- }
-
- return nil, errors.New("Unknown message type")
-}
-
-type Message struct {
- Type MsgType `json:"type"`
- User string `json:"user"`
- Text string `json:"text,omitempty"`
-}
-
type Room struct {
Messages chan Message
Buddies map[string]Buddy