Skip to content

Commit

Permalink
Fix handling IG like hearts
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanseymour committed Oct 10, 2023
1 parent 081aff8 commit acb5441
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions handlers/meta/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,9 @@ func (h *handler) processFacebookInstagramPayload(ctx context.Context, channel c
if att.Type == "image" && att.Payload != nil && att.Payload.StickerID != 0 {
text = stickerIDToEmoji[att.Payload.StickerID]
}
if att.Type == "like_heart" {
text = "❤️"
}

if att.Type == "location" {
attachmentURLs = append(attachmentURLs, fmt.Sprintf("geo:%f,%f", att.Payload.Coordinates.Lat, att.Payload.Coordinates.Long))
Expand Down
2 changes: 1 addition & 1 deletion handlers/meta/instagram_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ var instagramIncomingTests = []IncomingTestCase{
Data: string(test.ReadFile("./testdata/ig/like_heart.json")),
ExpectedRespStatus: 200,
ExpectedBodyContains: "Handled",
ExpectedMsgText: Sp(""),
ExpectedMsgText: Sp("❤️"),
ExpectedURN: "instagram:5678",
ExpectedExternalID: "external_id",
ExpectedDate: time.Date(2016, 4, 7, 1, 11, 27, 970000000, time.UTC),
Expand Down

0 comments on commit acb5441

Please sign in to comment.