Allow to join an open group
Also: * Refactor interacting with a remote event so that you can interact with a remote group as well * Add a setting for group admins to pick between an open and invite-only group * Fix new groups without posts/todos/resources/events/conversations URL set * Repair local groups that haven't got their posts/todos/resources/events/conversations URL set * Add a scheduled job to refresh remote groups every hour * Add a user setting to pick when to receive notifications when there's new members to approve (will be used when this feature is available) * Fix pagination for members Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
defmodule Mobilizon.Storage.Repo.Migrations.AddNotificationPendingMembershipToSettings do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
alter table(:user_settings) do
|
||||
add(:notification_pending_membership, :integer, default: 10)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,28 @@
|
||||
defmodule Mobilizon.Storage.Repo.Migrations.RepairGroupsWithMissingURLs do
|
||||
use Ecto.Migration
|
||||
alias Mobilizon.Actors.Actor
|
||||
alias Mobilizon.Storage.Repo
|
||||
import Ecto.{Changeset, Query}
|
||||
|
||||
def up do
|
||||
Actor
|
||||
|> where([a], a.type == :Group and is_nil(a.domain))
|
||||
|> Repo.all()
|
||||
|> Enum.each(&fix_group/1)
|
||||
end
|
||||
|
||||
def down do
|
||||
IO.puts("Nothing to revert here, this is a repair step.")
|
||||
end
|
||||
|
||||
defp fix_group(%Actor{type: :Group, domain: nil, url: url} = group) do
|
||||
group
|
||||
|> change(%{})
|
||||
|> put_change(:resources_url, "#{url}/resources")
|
||||
|> put_change(:todos_url, "#{url}/todos")
|
||||
|> put_change(:posts_url, "#{url}/posts")
|
||||
|> put_change(:events_url, "#{url}/events")
|
||||
|> put_change(:discussions_url, "#{url}/discussions")
|
||||
|> Repo.update()
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user