{:ok, create} = CommonAPI.post_chat_message(other_user, user, "sup")
{:ok, _create} = CommonAPI.post_chat_message(other_user, user, "sup part 2")
{:ok, chat} = Chat.get_or_create(user.id, other_user.ap_id)
{:ok, create} = CommonAPI.post_chat_message(other_user, user, "sup")
{:ok, _create} = CommonAPI.post_chat_message(other_user, user, "sup part 2")
{:ok, chat} = Chat.get_or_create(user.id, other_user.ap_id)
cm_ref = MessageReference.for_chat_and_object(chat, object)
assert cm_ref.unread == true
cm_ref = MessageReference.for_chat_and_object(chat, object)
assert cm_ref.unread == true
{:ok, create} = CommonAPI.post_chat_message(other_user, user, "sup")
{:ok, _create} = CommonAPI.post_chat_message(other_user, user, "sup part 2")
{:ok, chat} = Chat.get_or_create(user.id, other_user.ap_id)
{:ok, create} = CommonAPI.post_chat_message(other_user, user, "sup")
{:ok, _create} = CommonAPI.post_chat_message(other_user, user, "sup part 2")
{:ok, chat} = Chat.get_or_create(user.id, other_user.ap_id)
cm_ref = MessageReference.for_chat_and_object(chat, object)
assert cm_ref.unread == true
cm_ref = MessageReference.for_chat_and_object(chat, object)
assert cm_ref.unread == true
{:ok, other_message} = CommonAPI.post_chat_message(recipient, user, "nico nico ni")
{:ok, other_message} = CommonAPI.post_chat_message(recipient, user, "nico nico ni")
assert %{data: %{"type" => "Tombstone"}} = Object.get_by_id(object.id)
# Deleting other people's messages just removes the reference
assert %{data: %{"type" => "Tombstone"}} = Object.get_by_id(object.id)
# Deleting other people's messages just removes the reference
- :timer.sleep(1000)
- {:ok, _chat_2} = Chat.get_or_create(user.id, jafnhar.ap_id)
- :timer.sleep(1000)
+ {:ok, chat_1} = time_travel(chat_1, -3)
+ {:ok, chat_2} = Chat.get_or_create(user.id, jafnhar.ap_id)
+ {:ok, _chat_2} = time_travel(chat_2, -2)