data = %{
local: false,
name: info.name,
- nickname: info.nickname,
+ nickname: info.nickname <> "@" <> info.host,
ap_id: info.uri,
info: info
}
+ # TODO: Make remote user changeset
+ # SHould enforce fqn nickname
Repo.insert(Ecto.Changeset.change(%User{}, data))
end
end
uri: uri,
hub: hub,
nickname: preferredUsername || name,
- name: displayName || name
+ name: displayName || name,
+ host: URI.parse(uri).host
}}
else e ->
{:error, e}
user = Repo.get(Pleroma.User, user.id)
assert user.name == "Constance Variable"
- assert user.nickname == "lambadalambda"
+ assert user.nickname == "lambadalambda@social.heldscal.la"
assert user.local == false
assert user.info["uri"] == uri
assert user.ap_id == uri
subject: "acct:shp@social.heldscal.la",
topic: "https://social.heldscal.la/api/statuses/user_timeline/29191.atom",
uri: "https://social.heldscal.la/user/29191",
+ host: "social.heldscal.la",
fqn: user
}
assert data == expected
subject: "https://social.heldscal.la/user/29191",
topic: "https://social.heldscal.la/api/statuses/user_timeline/29191.atom",
uri: "https://social.heldscal.la/user/29191",
+ host: "social.heldscal.la",
fqn: user
}
assert data == expected
hub: "https://mastodon.social/api/push",
uri: "https://mastodon.social/users/lambadalambda",
nickname: "lambadalambda",
- name: "Critical Value"
+ name: "Critical Value",
+ host: "mastodon.social"
}
assert expected == discovered