Skip to content

Real-Time Chat

gcphone-next uses FiveM native events for all real-time chat functionality. No external Socket.IO server is required.

How It Works

All chat features use FiveM's built-in event system:

  • Sending: NUI → fetchNui() → Client RegisterNUICallback → Server lib.callback → oxmysql
  • Receiving: Server TriggerClientEvent → Client RegisterNetEvent → NUI SendNUIMessageuseNuiEvent

No Docker, no ports, no SSL certificates, no JWT secrets. Chat works out of the box.

Features

FeaturePersistenceHow it works
WaveChat Groupsphone_chat_group_messages (MySQL)Messages stored in DB, pushed to group members via TriggerClientEvent
WaveChat DMsphone_wavechat_dm_messages (MySQL)Messages stored in DB, pushed to receiver via TriggerClientEvent
WaveChat TypingEphemeral (not stored)Broadcast to group members or DM target only
SnapLive ChatIn-memory onlyBroadcast to all players, cleared when stream ends
SnapLive ReactionsIn-memory onlyBroadcast to all viewers
MatchMyLove Chatphone_matchmylove_messages (MySQL)Messages stored in DB, pushed to match partner
MatchMyLove TypingEphemeral (not stored)Sent only to match partner

Auto-Cleanup

All chat data has automatic retention policies:

DataRetentionMechanism
WaveChat Group messages7 daysServer-side cleanup
WaveChat DMs14 days, max 50 per conversationMySQL triggers (auto on INSERT)
WaveChat Statuses24 hoursExpiry column + cleanup
SnapLive ChatDuration of streamIn-memory, cleared on stream end
MatchMyLove messages14 daysServer-side cleanup

Security

  • All chat operations are validated server-side (identifier, group membership, match participation)
  • Rate limiting on all send operations (configurable per feature)
  • Input sanitization on all text content (strips control characters, enforces max length)
  • Messages are only delivered to authorized recipients (group members, DM target, match partner)
  • SnapLive moderation (mute/delete) restricted to stream owner

Released under GPL-3.0 License