Take control over your live stream video by running it yourself. Streaming + chat out of the box.
HTML activitypubbroadcastingchatdecentralizedfederationfediversegolanghacktoberfesthlslivelivestreamowncastrtmpself-hostedstreaming-videovideo
Remove message image from go code
Jannik Volkland35d7af0a60fb
diff --git a/core/chat/persistence.go b/core/chat/persistence.goindex 317ef46642..14958689e8 100644--- a/core/chat/persistence.go+++ b/core/chat/persistence.go@@ -36,7 +36,6 @@ func createTable(db *sql.DB) {"id" string NOT NULL PRIMARY KEY,"author" TEXT,"body" TEXT,- "image" TEXT,"messageType" TEXT,"visible" INTEGER,"timestamp" DATE@@ -51,11 +50,11 @@ func createTable(db *sql.DB) {func addMessage(message models.ChatMessage) {tx, err := _db.Begin()- stmt, err := tx.Prepare("INSERT INTO messages(id, author, body, image, messageType, visible, timestamp) values(?, ?, ?, ?, ?, ?, ?)")+ stmt, err := tx.Prepare("INSERT INTO messages(id, author, body, messageType, visible, timestamp) values(?, ?, ?, ?, ?, ?)")if err != nil {log.Fatal(err)}- _, err = stmt.Exec(message.ID, message.Author, message.Body, message.Image, message.MessageType, 1, message.Timestamp)+ _, err = stmt.Exec(message.ID, message.Author, message.Body, message.MessageType, 1, message.Timestamp)if err != nil {log.Fatal(err)}@@ -78,12 +77,11 @@ func getChatHistory() []models.ChatMessage {var id stringvar author stringvar body string- var image stringvar messageType stringvar visible intvar timestamp time.Time- err = rows.Scan(&id, &author, &body, &image, &messageType, &visible, ×tamp)+ err = rows.Scan(&id, &author, &body, &messageType, &visible, ×tamp)if err != nil {log.Fatal(err)}@@ -92,7 +90,6 @@ func getChatHistory() []models.ChatMessage {message.ID = idmessage.Author = authormessage.Body = body- message.Image = imagemessage.MessageType = messageTypemessage.Visible = visible == 1message.Timestamp = timestampdiff --git a/core/chat/server.go b/core/chat/server.goindex 87b3118642..ad70972d5b 100644--- a/core/chat/server.go+++ b/core/chat/server.go@@ -140,7 +140,7 @@ func (s *server) sendWelcomeMessageToClient(c *Client) {time.Sleep(7 * time.Second)initialChatMessageText := fmt.Sprintf("Welcome to %s! %s", config.Config.InstanceDetails.Title, config.Config.InstanceDetails.Summary)- initialMessage := models.ChatMessage{"owncast-server", config.Config.InstanceDetails.Name, initialChatMessageText, config.Config.InstanceDetails.Logo.Small, "initial-message-1", "CHAT", true, time.Now()}+ initialMessage := models.ChatMessage{"owncast-server", config.Config.InstanceDetails.Name, initialChatMessageText, "initial-message-1", "CHAT", true, time.Now()}c.Write(initialMessage)}()diff --git a/models/chatMessage.go b/models/chatMessage.goindex 5080c26696..af65b385d9 100644--- a/models/chatMessage.go+++ b/models/chatMessage.go@@ -18,7 +18,6 @@ type ChatMessage struct {Author string `json:"author"`Body string `json:"body"`- Image string `json:"image"`ID string `json:"id"`MessageType string `json:"type"`Visible bool `json:"visible"`diff --git a/openapi.yaml b/openapi.yamlindex 8ab5692da1..3ee81ec634 100644--- a/openapi.yaml+++ b/openapi.yaml@@ -307,9 +307,6 @@ paths:body:type: stringdescription: Escaped HTML of the chat message content.- image:- type: string- description: URL of the chat user avatar.id:type: stringdescription: Unique ID of the chat message.