Blind and silent truncation on post message

master
Matthieu Lalonde 5 years ago
parent abe61016e7
commit d49d174c10

@ -277,6 +277,5 @@ func (avr *AltVR) AcknowkledgeConversation(conversationID string) error {
// PostNewConversation send a new message
func (avr *AltVR) PostNewConversation(userID, message string) error {
// XXX: Truncate 140 chars
return avr.postNewConversation(userID, message)
}

@ -13,6 +13,7 @@ import (
"strconv"
"strings"
"git.lalonde.me/matth/AltVRBot/pkg/utils"
"github.com/PuerkitoBio/goquery"
"golang.org/x/net/html"
)
@ -217,6 +218,7 @@ func (avr *AltVR) fetchPendingConversations() ([]Conversation, error) {
func (avr *AltVR) postNewConversation(userID, message string) error {
uid, _ := strconv.ParseUint(userID, 10, 64)
message = utils.TruncateString(message, 140)
jv, _ := json.Marshal(&ConversationNewMessageOutgoing{
Conversation: ConversationNewMessage{
UserID: uid,

Loading…
Cancel
Save