From 6107a0495a3c1923ac5abb3a9c407b8ec1594088 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=AEittaG=20ordnasselA?= Date: Thu, 23 May 2019 16:31:15 +0200 Subject: [PATCH] Remove names from mastodon, fix images maybe?! --- mods/mastodon.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mods/mastodon.go b/mods/mastodon.go index b3820c6..6dc0d20 100644 --- a/mods/mastodon.go +++ b/mods/mastodon.go @@ -8,7 +8,6 @@ import ( "fmt" "log" "os" - "strings" "git.fromouter.space/hamcha/tg" "github.com/mattn/go-mastodon" @@ -112,7 +111,11 @@ func mastodon_message(broker *tg.Broker, update tg.APIMessage) { return } - status, err := sendToot(strings.TrimSpace(fmt.Sprintf("%s\n\n(da %s)", *(update.Caption), update.User.FirstName)), attach.ID) + text := "" + if update.Caption != nil { + text = *(update.Caption) + } + status, err := sendToot(text, attach.ID) if err != nil { log.Printf("[mastodon] Send toot failed: %s\n", err.Error()) broker.SendTextMessage(update.Chat, "ERRORE! @hamcha controlla la console!", &tg.MessageOptions{ @@ -127,7 +130,7 @@ func mastodon_message(broker *tg.Broker, update tg.APIMessage) { return } - status, err := sendToot(fmt.Sprintf("%s\n\n(da %s)", *(update.Text), update.User.FirstName), "") + status, err := sendToot(*(update.Text), "") if err != nil { log.Printf("[mastodon] Send toot failed: %s\n", err.Error()) broker.SendTextMessage(update.Chat, "ERRORE! @hamcha controlla la console!", &tg.MessageOptions{