Skip to content
Snippets Groups Projects

Emoji reactions: Add `reacted` field

Merged lain requested to merge emoji-reactions-reacted into develop
1 unresolved thread

This is an analog to the favourited and reblogged fields.

cc @shpuld

Merge request reports

Pipeline #22363 passed

Pipeline passed for b3a877d6 on emoji-reactions-reacted

Test coverage 86.90% (0.00%) from 1 job
Approval is optional

Merged by rinpatchrinpatch 5 years ago (Jan 30, 2020 1:16pm UTC)

Merge details

  • Changes merged into develop with 263abe3b.
  • Deleted the source branch.

Pipeline #22404 passed

Pipeline passed for 263abe3b on develop

Test coverage 86.90% (0.00%) from 1 job

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
47 47 Object.normalize(activity) do
48 48 reactions =
49 49 emoji_reactions
50 |> Enum.map(fn [emoji, users] ->
51 users = Enum.map(users, &User.get_cached_by_ap_id/1)
50 |> Enum.map(fn [emoji, user_ap_ids] ->
51 users =
52 Enum.map(user_ap_ids, &User.get_cached_by_ap_id/1)
53 |> Enum.filter(& &1)
52 54
53 55 %{
54 56 emoji: emoji,
55 57 count: length(users),
56 accounts: AccountView.render("index.json", %{users: users, for: user, as: :user})
58 accounts: AccountView.render("index.json", %{users: users, for: user, as: :user}),
59 reacted: !!(user && user.ap_id in user_ap_ids)
  • merged

  • rinpatch mentioned in commit 263abe3b

    mentioned in commit 263abe3b

  • Please register or sign in to reply
    Loading