• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/lib/update/chatconfigconverter.php
  • Класс: BitrixImUpdateChatConfigConverter
  • Вызов: ChatConfigConverter::convertNotifySettings
private function convertNotifySettings(array $oldUserSettings): array
{
	if (empty(self::$notifyDefaultSettings))
	{
		self::$notifyDefaultSettings = Notification::getSimpleNotifySettings(General::getDefaultSettings());
	}

	$newFormatSettings = [];
	foreach ($oldUserSettings as $name => $value)
	{
		[$type, $module, $event] = explode('|', $name, 3);

		switch ($type)
		{
			case 'site':
				$type = 1;
				break;

			case 'email':
				$type = 2;
				break;

			case 'xmpp':
				$type = 3;
				break;

			case 'push':
				$type = 4;
				break;
		}
		$newName = implode('|', ['no', $module, $event, $type]);

		$newFormatSettings[] = [
			'NAME' => $newName,
			'VALUE' => $value ? 'Y' : 'N'
		];
	}

	$newSettings = BitrixImConfigurationNotification::decodeSettings($newFormatSettings);
	return array_replace_recursive(self::$notifyDefaultSettings, $newSettings);

}