Chat Tab

CONNECT SRMAP - INBOX DATA DATA LOGIC

SECURITY, TIMERS & SERVER CHECKS

1. TIMEZONE & CACHE CONTROL

Strict Indian Standard Time: The system forces an absolute MySQL timezone sync (+05:30) so live unread counters, chat timings, and active indicators update instantly at 12:00 AM midnight.
Zero Cache Shields: Deploys strict HTTP headers (no-store, no-cache) to block browsers from storing chat structures, forcing message grids to load real-time variations on every refresh.
Data Compression Tunnels: The background endpoint packages data streams into lightweight compressed outputs (ob_gzhandler) to maintain lightning-fast response times on weak mobile networks.

2. SESSION VALIDATION CHECKS

The tracking matrix monitors your personal 11-digit university ID and auto-purges your active session parameters if your account row is missing.
If an asset or image directory is empty, a safe fallback template replaces broken links with a clean default placeholder picture automatically.
Banned profiles face immediate hardware lockout parameters that completely stop backend chat data streams from transmitting.

CONVERSATIONS & UNREAD FILTERS

1. CONVERSATION ARCHIVES

Unified Inbox Grouping: The database runs cross-union queries to merge incoming and outgoing messages into a single chat list sorted by the latest activity timestamp.
Live Typing Indicator: Real-time listeners monitor typing status logs to flag a chat item as "Typing..." if your friend is active within a 15-second window.
Admins & Official Pins: Official announcements (OFFICIAL_ACCOUNT) and help channels (ADMIN) bypass standard parameters and lock to the absolute top of your inbox.

2. SMART UNREAD HIGHLIGHTS

The unread category isolates conversations and applies distinct data counters tracking exactly how many messages are waiting for you.
New alerts update course headers with a high-contrast text label while older items remain plain white for visual balance.
If a student deletes a message bubble, the inbox string auto-swaps to display a specialized "🚫 Message Deleted" text warning template.

CONNECTION & REQUEST TUNNELS

1. FOLLOW INVITATIONS

Incoming Requests: Filters out the IDs of students who followed your profile but whom you haven't followed back yet.
Priority Sorting Toggles: If incoming friend requests are pending, the chat module automatically shifts the requests tab to the primary front position.
Outgoing Pending Feed: Separates and logs classmate profiles whom you followed but who haven't accepted your connection stream yet.

2. ACCOUNTABILITY ENGINE

Tapping a pending row directs your view cleanly to their profile summary to evaluate credentials before following back.
Blocking or unfollowing a profile removes their data tracking elements from your requests grid cleanly.
If your inbox requests feed is clear, a "No Pending Requests" state loads with a direct button link to explore campus hubs.

CLASSMATES HUB (SECTION MATES)

1. SECTION BOUNDARY SEPARATORS

Class Group Isolator: The engine parses your profile table strings to pull classmate rows matching your exact engineering code and section letter.
Priority Row Highlights: Mutual friends inside your section layer to the absolute top of the list, followed by other class colleagues alphabetically.
Campus Identity Tags: Non-mutual section rows display clear departmental tags alongside quick follow shortcut links.

2. VISITOR LOGGING CONTROLS

The classmates portal operates behind verified university tokens, blocking outside guest accounts from browsing your class group roster.
Tapping any section row opens a secure chat session immediately without interrupting your background inbox background framework.
Rows highlight with soft gray borders on hover, indicating active click boundaries clearly before navigation.

SHARED FILES LIBRARY

1. DIGITAL MEDIA ARCHIVES

Asset Grouping: Automatically reads message data strings to parse uploaded media into neat history logs based on creation timestamps.
Relative Date Categories: Files are organized under clear time sections like Today, Yesterday, This Month, Last Month, and Earlier.
Indicator Icons: Renders customized icons based on file extensions: camera shapes for photos, document pages for PDFs, and charts for presentations.

2. SIZE STORAGE METRICS

The background code calculates attachment bits to convert heavy numbers into simple strings (e.g., KB or MB formats).
File logs print the exact first name of the sender alongside file metrics so you can verify who shared the attachment.
If an attachment is missing or unlinked from the server directory, a custom exclamation warning block covers the preview row safely.

IMPORTANT NOTES:

The messaging system evaluates live status colors (green for active, yellow/orange for away) by parsing time differences since the last recorded login history entry.
Media libraries filter out attachment variables from deleted message bubbles instantly to prevent dead links on your screen.
The load-more pagination parameters utilize 15-item array slices to keep your inbox browsing clean and completely smooth on mobile devices.

Inbox Query Sync Portal: fetch_chat_data.php