<?php

return [
    'realtime' => (bool) env('MESSAGING_REALTIME', false),

    'broadcast' => [
        'queue' => env('MESSAGING_BROADCAST_QUEUE', 'broadcasts'),
    ],

    'typing' => [
        'ttl_seconds' => (int) env('MESSAGING_TYPING_TTL', 8),
        'cache_store' => env('MESSAGING_TYPING_CACHE_STORE', 'redis'),
    ],

    'presence' => [
        'ttl_seconds' => (int) env('MESSAGING_PRESENCE_TTL', 90),
        'conversation_ttl_seconds' => (int) env('MESSAGING_CONVERSATION_PRESENCE_TTL', 45),
        'cache_store' => env('MESSAGING_PRESENCE_CACHE_STORE', env('MESSAGING_TYPING_CACHE_STORE', 'redis')),
    ],

    'recovery' => [
        'max_messages' => (int) env('MESSAGING_RECOVERY_MAX_MESSAGES', 100),
    ],

    'notifications' => [
        'offline_fallback_only' => (bool) env('MESSAGING_OFFLINE_FALLBACK_ONLY', true),
    ],

    'search' => [
        'index' => env('MESSAGING_MEILI_INDEX', 'messages'),
        'page_size' => (int) env('MESSAGING_SEARCH_PAGE_SIZE', 20),
    ],

    'reactions' => [
        'allowed' => ['👍', '❤️', '🔥', '😂', '👏', '😮'],
    ],

    'attachments' => [
        'disk' => env('MESSAGING_ATTACHMENTS_DISK', 'local'),
        'max_files' => (int) env('MESSAGING_ATTACHMENTS_MAX_FILES', 5),
        'max_image_kb' => (int) env('MESSAGING_ATTACHMENTS_MAX_IMAGE_KB', 10240),
        'max_file_kb' => (int) env('MESSAGING_ATTACHMENTS_MAX_FILE_KB', 25600),
        'allowed_image_mimes' => ['image/jpeg', 'image/png', 'image/webp'],
        'allowed_file_mimes' => ['application/pdf', 'application/zip', 'application/x-zip-compressed'],
    ],
];
