Class: Chat::Service::UpdateChannel

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
plugins/chat/app/services/update_channel.rb

Overview

Service responsible for updating a chat channel’s name, slug, and description.

For a CategoryChannel, the settings for auto_join_users and allow_channel_wide_mentions are also editable.

Examples:

Chat::Service::UpdateChannel.call(
 channel_id: 2,
 guardian: guardian,
 name: "SuperChannel",
 description: "This is the best channel",
 slug: "super-channel",
)

Instance Method Summary collapse

Methods included from Base

contract, model, policy, step, transaction

Instance Method Details

#call(channel_id: , guardian: , **params_to_edit) ⇒ Chat::Service::Base::Context

Parameters:

  • channel_id (Integer) (defaults to: )
  • guardian (Guardian) (defaults to: )
  • params_to_edit (Hash)

Options Hash (**params_to_edit):

  • name (String, nil)
  • description (String, nil)
  • slug (String, nil)
  • auto_join_users (Boolean)

    Only valid for CategoryChannel. Whether active users with permission to see the category should automatically join the channel.

  • allow_channel_wide_mentions (Boolean)

    Allow the use of @here and @all in the channel.

Returns: