Closed Sakrecoer closed 3 years ago
Thanks @Sakrecoer, I'll look into this!
In beehive/mastodonbee/events.go
we have the following code (line 177):
{
Name: "username",
Value: notif.Account.DisplayName,
Type: "string",
},
The event field username
is indeed mapped with notif.Account.DisplayName
.
However, here is an extract of the information returned by the Mastodon GET ACCOUNT API (https://docs.joinmastodon.org/methods/accounts/#retrieve-information):
"id": "23634",
"username": "noiob",
"acct": "noiob@awoo.space",
"display_name": "shork",
My proposition is to implement the following change:
username
from the Mastodon API field display_name
to username
(it may introduce regression if a user was wrongly using this field)display_name
mapped to the Mastodon API field display_name
(users having a regression will have to use this field instead)acct
mapped to the Mastodon API field acct
(this field will be used by @Sakrecoer to retrieve the handler)To be noted, and specified by the Mastodon API documentation, in the case of a local user, the fields acct
and username
have the same value.
Local user
"id": "1",
"username": "Gargron",
"acct": "Gargron",
"display_name": "Eugen",
Remote user
"id": "23634",
"username": "noiob",
"acct": "noiob@awoo.space",
"display_name": "shork",
@muesli If you agree with this change, I will introduce a PR this week.
Hi!
Thanks for an awesome tool!
I have been experimenting with the mastodon bees and actions and found an inconsistency and an unexpected behavior with
{{.username}}
. For reblog action, the definition states: "Mastodon handle of the user that re-blogged your toot" For follow action, the definition states: "Mastodon handle of the user which triggered the follow event"1. Inconsistency
Expected result: As stated by the definitions of the action
Result: When the action is follow,
{{.username}}
prints the display name of the user following our account. When the action is reblog,{{.username}}
prints the display name of our account.2. Unexpected behavior (potentially wish-list)
Expected result
{{.username}}
prints the users handler:@user@example.com
Result
{{.username}}
prints the user's display name: 🦄 User's cool display name 🎉While it is interesting to access the display name, it would be even nicer to get the handler
@user@example.com
because of how actionable it is compared to the display-name. This is what i expected the role of{{.user_id}}
to be, but the latter seems to print the digits associated with the user (ex: 765432).