streamables =
[[actor, recipient], [recipient, actor]]
+ |> Enum.uniq()
|> Enum.map(fn [user, other_user] ->
if user.local do
{:ok, chat} = Chat.bump_or_create(user.id, other_user.ap_id)
describe "posting chat messages" do
setup do: clear_config([:instance, :chat_limit])
+ test "it posts a self-chat" do
+ author = insert(:user)
+ recipient = author
+
+ {:ok, activity} =
+ CommonAPI.post_chat_message(
+ author,
+ recipient,
+ "remember to buy milk when milk truk arive"
+ )
+
+ assert activity.data["type"] == "Create"
+ end
+
test "it posts a chat message without content but with an attachment" do
author = insert(:user)
recipient = insert(:user)