You are here

function social_private_message_install in Open Social 8.9

Same name and namespace in other branches
  1. 8 modules/social_features/social_private_message/social_private_message.install \social_private_message_install()
  2. 8.2 modules/social_features/social_private_message/social_private_message.install \social_private_message_install()
  3. 8.3 modules/social_features/social_private_message/social_private_message.install \social_private_message_install()
  4. 8.4 modules/social_features/social_private_message/social_private_message.install \social_private_message_install()
  5. 8.5 modules/social_features/social_private_message/social_private_message.install \social_private_message_install()
  6. 8.6 modules/social_features/social_private_message/social_private_message.install \social_private_message_install()
  7. 8.7 modules/social_features/social_private_message/social_private_message.install \social_private_message_install()
  8. 8.8 modules/social_features/social_private_message/social_private_message.install \social_private_message_install()
  9. 10.3.x modules/social_features/social_private_message/social_private_message.install \social_private_message_install()
  10. 10.0.x modules/social_features/social_private_message/social_private_message.install \social_private_message_install()
  11. 10.1.x modules/social_features/social_private_message/social_private_message.install \social_private_message_install()
  12. 10.2.x modules/social_features/social_private_message/social_private_message.install \social_private_message_install()

Implements hook_uninstall().

File

modules/social_features/social_private_message/social_private_message.install, line 14
The Social Private Message (de)installation file.

Code

function social_private_message_install() {
  _social_private_message_set_permissions();

  // Disable the email notification provided by private_message.

  /** @var \Drupal\Core\Config\Config|\Drupal\Core\Config\ImmutableConfig $config */
  \Drupal::getContainer()
    ->get('config.factory')
    ->getEditable('private_message.settings')
    ->set('enable_email_notifications', FALSE)
    ->set('send_by_default', FALSE)
    ->save();

  // Set module weight.
  module_set_weight('social_private_message', 1);

  // Alter display configuration of the private message module.
  _social_private_message_set_private_message_default_form_settings();
  _social_private_message_set_private_message_default_view_settings();
  _social_private_message_set_private_message_inbox_view_settings();
  _social_private_message_set_private_message_thread_default_view_settings();
}