1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-09-15 17:46:55 +00:00

Let's start caching some of the backlog data on the server

This commit is contained in:
Kane York 2015-10-26 10:07:15 -07:00
parent 8918b9ac3a
commit ae1306387e
4 changed files with 214 additions and 7 deletions

View file

@ -74,14 +74,16 @@ func HBackendPublishRequest(w http.ResponseWriter, r *http.Request) {
cmd := formData.Get("cmd")
json := formData.Get("args")
chat := formData.Get("chat")
watchChannel := formData.Get("channel")
channel := formData.Get("channel")
scope := formData.Get("scope")
cm := ClientMessage{MessageID: -1, Command: Command(cmd), origArguments: json}
var count int
if chat != "" {
count = PublishToChat(chat, cm)
} else if watchChannel != "" {
count = PublishToWatchers(watchChannel, cm)
if scope == "chat" {
count = PublishToChat(channel, cm)
} else if scope == "channel" {
count = PublishToWatchers(channel, cm)
} else if scope == "global" {
count = PublishToAll(cm)
} else {
w.WriteHeader(400)
fmt.Fprint(w, "Need to specify either chat or channel")