McKael / madonctl

CLI client for the Mastodon social network API
MIT License
193 stars 9 forks source link

notifications stream deletions misbehaving #10

Closed wxl closed 6 years ago

wxl commented 6 years ago

Streaming notifications, I came across this:

Error event: [error] could not decode deletion: payload isn't a number

I guess someone deleted a notification of some kind? It's strange, I didn't see a matching notification in my other streams.

McKael commented 6 years ago

You need to update your template: Mastodon v2 has changed the API and IDs are now strings. In your template, {{printf "%.0f" .id}} should be replaced with just {{.id}} and {{if gt .in_reply_to_id 0.0}} should now be {{if gt .in_reply_to_id}}

HTH!

wxl commented 6 years ago

Yeah I figured that much out after running accounts notifications --list so I edited the issue. Just that deletion business.

McKael commented 6 years ago

OK, I see, I'll check the deletion error. Thanks for the report :)

wxl commented 6 years ago

Also gt won't work unless it's compared to something but you could use "0" although I think {{if .in_reply_to_id}} is probably sufficient. Dang ids are long now tho! :(

McKael commented 6 years ago

Yes IDs are long :)

McKael commented 6 years ago

@wxl Should be fixed (please update madon as well, both projects have been updated)...