"profile_image_url_https" => image,
"profile_image_url_profile_size" => image,
"profile_image_url_original" => image,
- "rights" => %{},
+ "rights" => %{
+ "delete_others_notice" => !!user.info["is_moderator"]
+ },
"screen_name" => user.nickname,
"statuses_count" => user_info[:note_count],
"statusnet_profile_url" => user.ap_id,
"following" => false,
"follows_you" => false,
"statusnet_blocking" => false,
- "rights" => %{},
+ "rights" => %{
+ "delete_others_notice" => false
+ },
"statusnet_profile_url" => user.ap_id,
"cover_photo" => banner,
"background_image" => nil,
"following" => true,
"follows_you" => false,
"statusnet_blocking" => false,
- "rights" => %{},
+ "rights" => %{
+ "delete_others_notice" => false
+ },
"statusnet_profile_url" => user.ap_id,
"cover_photo" => banner,
"background_image" => nil,
"following" => false,
"follows_you" => true,
"statusnet_blocking" => false,
- "rights" => %{},
+ "rights" => %{
+ "delete_others_notice" => false
+ },
"statusnet_profile_url" => follower.ap_id,
"cover_photo" => banner,
"background_image" => nil,
assert represented == UserView.render("show.json", %{user: follower, for: user})
end
+ test "a user that is a moderator" do
+ user = insert(:user, %{info: %{"is_moderator" => true}})
+ represented = UserView.render("show.json", %{user: user, for: user})
+
+ assert represented["rights"]["delete_others_notice"]
+ end
+
test "A blocked user for the blocker" do
user = insert(:user)
blocker = insert(:user)
"following" => false,
"follows_you" => false,
"statusnet_blocking" => true,
- "rights" => %{},
+ "rights" => %{
+ "delete_others_notice" => false
+ },
"statusnet_profile_url" => user.ap_id,
"cover_photo" => banner,
"background_image" => nil,