1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-14 01:50:54 +00:00

Reformat and add global message subscriptions

This commit is contained in:
Kane York 2015-10-26 10:06:45 -07:00
parent df7d607556
commit 8918b9ac3a
11 changed files with 182 additions and 158 deletions

View file

@ -1,11 +1,11 @@
package server
import (
"golang.org/x/net/websocket"
"github.com/satori/go.uuid"
"golang.org/x/net/websocket"
"log"
"sync"
"strconv"
"sync"
"time"
)
@ -23,7 +23,7 @@ func HandleCommand(conn *websocket.Conn, client *ClientInfo, msg ClientMessage)
return
}
// log.Println(conn.RemoteAddr(), msg.MessageID, msg.Command, msg.Arguments)
// log.Println(conn.RemoteAddr(), msg.MessageID, msg.Command, msg.Arguments)
response, err := CallHandler(handler, conn, client, msg)
@ -36,7 +36,7 @@ func HandleCommand(conn *websocket.Conn, client *ClientInfo, msg ClientMessage)
} else {
FFZCodec.Send(conn, ClientMessage{
MessageID: msg.MessageID,
Command: "error",
Command: "error",
Arguments: err.Error(),
})
}
@ -203,6 +203,7 @@ type SurveySubmission struct {
User string
Json string
}
var SurveySubmissions []SurveySubmission
var SurveySubmissionLock sync.Mutex
@ -215,11 +216,12 @@ func HandleSurvey(conn *websocket.Conn, client *ClientInfo, msg ClientMessage) (
}
type FollowEvent struct {
User string
Channel string
User string
Channel string
NowFollowing bool
Timestamp time.Time
Timestamp time.Time
}
var FollowEvents []FollowEvent
var FollowEventsLock sync.Mutex
@ -268,7 +270,6 @@ func HandleEmoticonUses(conn *websocket.Conn, client *ClientInfo, msg ClientMess
}
}
return ResponseSuccess, nil
}