+ client_posted_this_activity = opts[:for] && user.id == opts[:for].id
+
+ expires_in =
+ with true <- client_posted_this_activity,
+ expiration when not is_nil(expiration) <-
+ ActivityExpiration.get_by_activity_id(activity.id) do
+ expires_in_seconds =
+ expiration.scheduled_at
+ |> NaiveDateTime.diff(NaiveDateTime.utc_now(), :second)
+
+ round(expires_in_seconds / 60)
+ end
+