fix base64 encode of jsons
This commit is contained in:
@@ -1,6 +1,3 @@
|
|||||||
fix irc
|
|
||||||
|
|
||||||
|
|
||||||
chat history
|
chat history
|
||||||
rewrite to use uuid
|
rewrite to use uuid
|
||||||
media support
|
media support
|
||||||
|
|||||||
+1
-8
@@ -2,7 +2,6 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
|
||||||
"errors"
|
"errors"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
@@ -63,15 +62,9 @@ func sendMessageStructCloseIfTimeout(user *User, message *Message) {
|
|||||||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
jsonMsg, err := json.Marshal(message)
|
err := wsjson.Write(ctx, user.WsConn, message)
|
||||||
if err != nil {
|
|
||||||
log.Printf("json marshal error: %v", err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
err = wsjson.Write(ctx, user.WsConn, jsonMsg)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("json write error: %v", err)
|
log.Printf("json write error: %v", err)
|
||||||
return
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user