Skip to content

Commit

Permalink
MastodonBee - Account mapping fix and enhancement in events (#367)
Browse files Browse the repository at this point in the history
  • Loading branch information
corrantho authored Jan 28, 2021
1 parent 7e793ce commit f20bfda
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 6 deletions.
44 changes: 42 additions & 2 deletions bees/mastodonbee/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,19 @@ func (mod *MastodonBee) handleNotification(notif *mastodon.Notification) {
},
{
Name: "username",
Value: notif.Account.Username,
Type: "string",
},
{
Name: "display_name",
Value: notif.Account.DisplayName,
Type: "string",
},
{
Name: "acct",
Value: notif.Account.Acct,
Type: "string",
},
{
Name: "following",
Value: rel[0].Following,
Expand Down Expand Up @@ -153,9 +163,19 @@ func (mod *MastodonBee) handleNotification(notif *mastodon.Notification) {
},
{
Name: "username",
Value: notif.Account.Username,
Type: "string",
},
{
Name: "display_name",
Value: notif.Account.DisplayName,
Type: "string",
},
{
Name: "acct",
Value: notif.Account.Acct,
Type: "string",
},
{
Name: "text",
Value: notif.Status.Content,
Expand Down Expand Up @@ -187,7 +207,17 @@ func (mod *MastodonBee) handleNotification(notif *mastodon.Notification) {
},
{
Name: "username",
Value: notif.Status.Account.DisplayName,
Value: notif.Account.Username,
Type: "string",
},
{
Name: "display_name",
Value: notif.Account.DisplayName,
Type: "string",
},
{
Name: "acct",
Value: notif.Account.Acct,
Type: "string",
},
{
Expand Down Expand Up @@ -226,7 +256,17 @@ func (mod *MastodonBee) handleNotification(notif *mastodon.Notification) {
},
{
Name: "username",
Value: notif.Status.Account.DisplayName,
Value: notif.Account.Username,
Type: "string",
},
{
Name: "display_name",
Value: notif.Account.DisplayName,
Type: "string",
},
{
Name: "acct",
Value: notif.Account.Acct,
Type: "string",
},
{
Expand Down
48 changes: 44 additions & 4 deletions bees/mastodonbee/mastodonbeefactory.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,17 @@ func (factory *MastodonBeeFactory) Events() []bees.EventDescriptor {
},
{
Name: "username",
Description: "Mastodon handle of the user which triggered the follow event",
Description: "Mastodon username of the user which triggered the follow event",
Type: "string",
},
{
Name: "display_name",
Description: "Mastodon display name of the user which triggered the follow event",
Type: "string",
},
{
Name: "acct",
Description: "Mastodon account of the user which triggered the follow event",
Type: "string",
},
{
Expand Down Expand Up @@ -266,7 +276,17 @@ func (factory *MastodonBeeFactory) Events() []bees.EventDescriptor {
},
{
Name: "username",
Description: "The Mastodon handle of the user that favourited your toot",
Description: "The Mastodon username of the user that favourited your toot",
Type: "string",
},
{
Name: "display_name",
Description: "The Mastodon display name of the user that favourited your toot",
Type: "string",
},
{
Name: "acct",
Description: "The Mastodon account of the user that favourited your toot",
Type: "string",
},
{
Expand Down Expand Up @@ -335,7 +355,17 @@ func (factory *MastodonBeeFactory) Events() []bees.EventDescriptor {
},
{
Name: "username",
Description: "Mastodon handle of the user that reblogged your toot",
Description: "Mastodon username of the user that reblogged your toot",
Type: "string",
},
{
Name: "display_name",
Description: "Mastodon display name of the user that reblogged your toot",
Type: "string",
},
{
Name: "acct",
Description: "Mastodon account of the user that reblogged your toot",
Type: "string",
},
{
Expand Down Expand Up @@ -404,7 +434,17 @@ func (factory *MastodonBeeFactory) Events() []bees.EventDescriptor {
},
{
Name: "username",
Description: "The Mastodon handle of the mention's author",
Description: "The Mastodon username of the mention's author",
Type: "string",
},
{
Name: "display_name",
Description: "The Mastodon display_name of the mention's author",
Type: "string",
},
{
Name: "acct",
Description: "The Mastodon account of the mention's author",
Type: "string",
},
{
Expand Down

0 comments on commit f20bfda

Please sign in to comment.