Fix stream deletion events with Mastodon v2 API
authorMikael Berthe <mikael@lilotux.net>
Sat, 28 Oct 2017 22:43:54 +0200
changeset 198 2dd1ed9394f0
parent 197 485f5cfb4378
child 199 9d9d27e7bad2
Fix stream deletion events with Mastodon v2 API See https://github.com/McKael/madonctl/issues/10
streams.go
--- a/streams.go	Sat Oct 21 21:18:11 2017 +0200
+++ b/streams.go	Sat Oct 28 22:43:54 2017 +0200
@@ -129,13 +129,13 @@
 			}
 			obj = notif
 		case "delete":
-			floatPayload, ok := msg.Payload.(float64)
+			strPayload, ok := msg.Payload.(string)
 			if !ok {
-				e := errors.New("could not decode deletion: payload isn't a number")
+				e := errors.New("could not decode deletion: payload isn't a string")
 				events <- StreamEvent{Event: "error", Error: e}
 				continue
 			}
-			obj = int64(floatPayload) // statusID
+			obj = strPayload // statusID
 		default:
 			e := errors.Errorf("unhandled event '%s'", msg.Event)
 			events <- StreamEvent{Event: "error", Error: e}