Commits by Nikka
9 subscribers
164 links
Owned by @NikkaGameS
Download Telegram
🔨 1 new commit to ComuCompose:master:

1b843b7: Handle self-events and refactor socket encryption

- Update notification service to suppress alerts for self-events
- Correctly flag self-event messages in message handlers
- Move encryption logic to SocketService output stream
- Add device identifier to authentication requests and for multiclient support
- Restrict outgoing messages during socket reconnection

Signed-off-by: NikkaGames <[email protected]> by NikkaGames
🔨 1 new commit to ComuServer:main:

6e4aa2a: Refactor certificate loading and improve event handling

Refactored TCPServer to dynamically load the server certificate.
Enhanced event handling by ensuring the loop continues on
TryGetMe failure. Improved client disconnection logic by
removing redundant cleanup code and updating status management.
Added logging for certificate loading. by NikkaGames
🔨 1 new commit to ComuCompose:master:

4e305f7: Improve socket stability and state handling

- Handle SocketException explicitly in SocketService and add delays for state synchronization
- Ensure socket is open before attempting to send messages
- Guard status updates in ChatActivity and MainActivity based on connection state
- Prevent concurrent execution of relaunch in LoginActivity using AtomicBoolean
- Refactor avgColor to MutableState in MainActivity and provide fallback colors

Signed-off-by: NikkaGames <[email protected]> by NikkaGames
🔨 1 new commit to ComuCompose:master:

6507b74: Enhance Profile screen with new animations and visual effects

- Refactor Modifier.shimmer in Utils.kt to support configurable duration and delay intervals.
- Add Modifier.fadeOnCreate extension for simple fade-in entry animations.
- Implement GlowOverlay composable to render a radial gradient glow.
- Apply GlowOverlay to the profile header in ProfileActivity.
- Add fade animations to bio and join date text elements.
- Enable shimmer effect on the user's own profile avatar.
- Increase item loading delay in MainActivity from 35ms to 50ms.

Signed-off-by: NikkaGames <[email protected]> by NikkaGames
🔨 2 new commits to ComuCompose:master:

cf34ecb: Refactor chat list loading and item UI

- Offload icon decoding to the UI layer using asynchronous loading with LaunchedEffect
- Add shimmer placeholder effect for avatars while loading
- Simplify message preview text generation in Handlers by removing emoji-specific truncation logic
- Add fade-in animations to the chat list
- Enforce single-line limit with ellipsis for chat subtitles
- Switch LoadChats to use Dispatchers.IO

Signed-off-by: NikkaGames <[email protected]> by NikkaGames
b652aa5: Refactor chat list loading and item UI

- Offload icon decoding to the UI layer using asynchronous loading with LaunchedEffect
- Add shimmer placeholder effect for avatars while loading
- Simplify message preview text generation in Handlers by removing emoji-specific truncation logic
- Add fade-in animations to the chat list
- Enforce single-line limit with ellipsis for chat subtitles
- Switch LoadChats to use Dispatchers.IO

Optimize icon caching and rounded corner logic

- Store pre-rounded bitmaps in Handlers.icons to avoid re-processing on every retrieval.
- Update the cache retrieval logic to save and use the rounded version directly.
- Add clip(RoundedCornerShape) modifier to the Image composable for consistent visual styling.

Signed-off-by: NikkaGames <[email protected]> by NikkaGames
🔨 1 new commit to ComuServer:main:

18f5db0: Enhance MongoDB integration and streamline TCPServer

- Removed MongoDB.Driver.Core dependency from ComuServer.csproj.
- Added unique, case-insensitive index creation for username in the account collection.
- Introduced case-insensitive collation for MongoDB operations.
- Refactored GetIdByName to use aggregation with collation.
- Replaced hardcoded MongoDB connection string with MongoClientSettings.
- Configured ClusterConfigurator for MongoDB command logging.
- Simplified server initialization and removed redundant code.
- Removed GetOnlineDevices method.
- Adjusted formatting and fixed structural issues in TCPServer.cs. by NikkaGames
🔨 1 new commit to ComuServer:main:

c7f699a: Refactor MongoClient logic and improve lastm handling

Refactored MongoClient initialization to use a new mongoDbg
variable for determining the constructor. Updated lastm
retrieval logic to handle deleted messages by checking the
isdel field and setting appropriate values. Simplified the
default lastm value in the catch block for clarity. by NikkaGames
🔨 1 new commit to ComuCompose:master:

ea7506c: Refactor profile icon loading and optimize message parsing

- Implement asynchronous loading for user and chat icons with caching, shimmer placeholders, and fade animations in MainActivity and ChatActivity.
- Update avgChatColor to use mutable state for dynamic UI theming based on icon colors.
- Refactor message parsing logic to use dynamic delimiter indexing instead of fixed substrings in Handlers and ComuFirebaseService.
- Remove blocking retry loops for chat data retrieval and optimize notification preview generation.
- Remove underline styling from URL annotations and adjust color handling in ProfileActivity.

Signed-off-by: NikkaGames <[email protected]> by NikkaGames
🔨 1 new commit to ComuServer:main:

a92d73b: Add SetName method and integrate with SetBio handling

A new private method SetName was added to the TCPServer class to validate and update usernames in the account MongoDB collection. It ensures usernames are unique, non-null, and properly formatted. The method returns true on successful updates and false otherwise.

The HandleUserSetBioAsync method was updated to call SetName, allowing it to handle username updates alongside bio updates. Appropriate client responses are sent based on the success or failure of the SetName operation.

These changes enhance functionality by enabling username management while maintaining data integrity and uniqueness. by NikkaGames
🔨 1 new commit to ComuCompose:master:

e14787d: Refactor profile editing with an expandable UI

- Replace the bio update bottom sheet with a full-screen expandable editor animation.
- Allow updating both username and bio simultaneously in the new editor.
- Add ExpandableBox composable to handle the transition animation from profile info to the editor.
- Implement session validation in onResume to handle token mismatches.
- Add a connection loss alert dialog to ProfileActivity.
- Update Handlers.setProfileBio and parseSetProfileBio to accept and process username changes.
- Store and retrieve the user's bio in Singleton.

Signed-off-by: NikkaGames <[email protected]> by NikkaGames
🔨 1 new commit to ComuCompose:master:

77996e4: Push latest changes

* ProfileActivity.kt:
* Update logic for setting the user's bio in the Singleton instance; specifically handle the placeholder text ("Click to add a few words about yourself") by setting the bio to an empty string in that case.
* Add a new "Edit" button (pen icon) to the top-end of the profile screen layout.
* Configure the "Edit" button to open the profile editor pre-filled with the current user's name and bio.

Signed-off-by: NikkaGames <[email protected]> by NikkaGames
🔨 1 new commit to ComuCompose:master:

b8aa04b: Restrict bio updates and edit UI to current user's profile

Signed-off-by: NikkaGames <[email protected]> by NikkaGames
🔨 1 new commit to ComuCompose:master:

a0effcb: Refactor profile icon handling and update UI components

- Remove usage of getRoundedCroppedBitmap in favor of raw bitmaps for profile icons across Handlers, ChatActivity, ProfileActivity, and MainActivity.
- Rename getRoundedCroppedBitmap to getRoundedBitmap in Utils.
- Refactor ChatActivity TopAppBar to correctly utilize navigationIcon and actions slots, and reduce status animation duration.
- Update ProfileActivity layout to encapsulate username and bio editing fields within a styled Box.
- Enhance NativeComposeEditText in MainActivity with floating hint animations and custom text selection colors.
- Convert relaunching flag in LoginActivity to a mutable state and update log level.

Signed-off-by: NikkaGames <[email protected]> by NikkaGames
🔨 1 new commit to ComuCompose:master:

adb4bf4: Push latest changes

* ProfileActivity.kt: Apply fadeOnCreate animation to edit pen icon, check icon, and the main container box.
* ChatActivity.kt: Reset showDeleteDialog state on launch and apply fadeOnCreate to the call action icon.
* LoginActivity.kt: Update the condition for starting MainActivity to check if MainActivity.items is empty instead of checking focus states.

Signed-off-by: NikkaGames <[email protected]> by NikkaGames
🔨 1 new commit to ComuCompose:master:

310d0f3: Handle user name update events in message handler

- Add EVENT_USER_NAME_UPDATE_EVENT constant.
- Implement logic to update the user's name in MainActivity.items when the event is received.
- Trigger LoadChats if the user is not found in the current list or if the list is empty.

Signed-off-by: NikkaGames <[email protected]> by NikkaGames
🔨 2 new commits to ComuServer:main:

75a793f: Refactor chat handling and improve code readability

Refactored chat-related logic to enhance readability, reduce redundancy, and ensure consistency:
- Added ChatHasUsers method to validate chat participants.
- Replaced uid field from BsonDocument to BsonArray.
- Updated code to handle uid as an array across the codebase.
- Streamlined message iteration, pagination, and property updates.
- Refactored notification sending for efficiency and clarity.
- Improved handling of message history and deletion broadcasts.
- Ensured consistent use of ChatHasUsers for chat validation. by NikkaGames
a4376b1: Notify chat partners on user name update

Added a private method GetChatPartners to retrieve chat partners for a given user ID by querying the "chats" collection. Introduced BroadcastToUsers to send payloads to multiple users, ensuring active sessions and SSL authentication. Updated the SetBio method to notify chat partners of a user.nameupdate event when a user's name is updated. by NikkaGames
🔨 7 new commits to ComuCompose:master:

f0b6a83: Refactor socket request handling and optimize username update logic
Implement input validation and character limit counters for Profile bio and username
Improve chat scrolling behavior and customize runtime message animations
Add text cleanup utility for Latin-only input restrictions

Signed-off-by: NikkaGames <[email protected]> by NikkaGames
1cf06ad: Push latest changes

- Update server IP address in SocketService.
- Clean up dependencies in app/build.gradle: remove unused libs (ACRA, SafetyNet, debug tooling) and reformat.
- Update deployment target timestamp.

Signed-off-by: NikkaGames <[email protected]> by NikkaGames
eba7bdf: Push latest changes

Signed-off-by: NikkaGames <[email protected]> by NikkaGames
240c272: Fix infinite scroll pagination logic in ChatActivity

The LaunchedEffect collecting the visible item index was previously checking if (index > 16 || isLoadingMore.value) return@collect, which allowed multiple redundant load operations to fire or fail to reset properly.

This change introduces a loadTriggered state variable to debounce the loading mechanism. It now explicitly checks if (index <= 16 && !loadTriggered && !isLoadingMore.value) to start loading, setting loadTriggered = true. The flag is only reset when the user scrolls back down (index > 16), ensuring a cleaner cycle for fetching older messages.

Signed-off-by: NikkaGames <[email protected]> by NikkaGames
38c63e4: Integrate Opus audio codec via JNI

- Add native C++ implementation for Opus encoding and decoding, including CodecOpus wrapper and JNI bridge.
- Include prebuilt libopus and libopusenc shared libraries and headers for multiple ABIs.
- Add Kotlin wrapper class Opus.kt and configuration constants.
- Configure CMake and NDK support in app/build.gradle.
- Update server IP address in SocketService.

Signed-off-by: NikkaGames <[email protected]> by NikkaGames
a328a7e: Refactor socket connection to race between local and public IPs

- Update SocketService.kt to simultaneously attempt connections to both a local IP and a public IP, using the first successful connection.
- Define LOCAL_IP and PUBLIC_IP constants in SocketService.
- Adjust CallActivity.kt to set status bar appearance and color, and assign the current activity to Handlers.
- Switch deployment target selection mode to dialog in .idea/deploymentTargetSelector.xml.

Signed-off-by: NikkaGames <[email protected]> by NikkaGames
14e4cc5: Simplify socket connection and update chat pagination

- SocketService.kt: Remove the concurrent race logic for connecting via local vs. public IP; simplify to directly connecting to the public IP.
- ChatActivity.kt: Refactor scroll listener logic to better trigger message pagination when the list reaches the top (index 0) or the threshold, ensuring history loads correctly.

Signed-off-by: NikkaGames <[email protected]> by NikkaGames
🔨 4 new commits to ComuServer:main:

e28802e: Refactor servers and improve BSON handling

Refactored TCPServer to use IPAddress for IP handling and improved BSON document processing. Enhanced UdpRelayServer with structured ClientState, binary parsing, and better relay logic. Removed legacy code and improved readability with consistent naming and updated console messages. by NikkaGames
40078d7: Add call handling, registries, and UDP enhancements

Introduced call handling in TCPServer.cs with new methods for
call events and integration with CallRegistry. Added CallRegistry
and CallSession to manage call sessions. Enhanced UdpServer.cs
for real-time call handling, including packet parsing, client
association, and cleanup logic. Introduced RealtimeClient and
RealtimeRegistry for managing real-time clients. Refactored
UdpServer.cs for improved packet handling and room management.
General improvements include better cleanup logic and streamlined
access to CallRegistry. by NikkaGames
95f328f: Refactor session handling to include TcpClient details

Enhanced DeviceSession to store TcpClient for connection
details. Updated DispatchCore and all handler methods to
accept TcpClient as a parameter, ensuring client context
is available during event handling. Improved LoadCert
logging and removed redundant debug messages. Replaced
PrintUsersExt logic to display detailed per-device info
(IP and port). Adjusted handler invocations and session
creation to integrate TcpClient seamlessly. by NikkaGames
07298d2: Improve null checks, flow control, and exception handling

Added a condition to handle cases where the total number of
devices is zero, ensuring no unnecessary output. Introduced
null checks for session and session.client to prevent
null reference errors. Refactored the infinite loop to include
a try block for message processing, handling IOException
gracefully by breaking the loop. Adjusted continue
statements for better flow control and to avoid redundant
iterations during exceptions. by NikkaGames
🔨 2 new commits to ComuCompose:master:

49aeeab: Refactor message handling to use a sequential operation queue

This commit introduces a sequential operation queue (opQueue) to process message-related actions (add, delete) in order. This prevents race conditions and ConcurrentModificationException errors.

Key changes:
- `Handlers.kt`:
- Implemented a Channel`-based queue (`opQueue) to handle message operations (AddFront, AddBack, RemoveById) sequentially.
- Added addMessageFront, addMessage, and deleteMessageByMid to enqueue operations.
- A new startOpWorker coroutine processes the queue.
- The EVENT_MSG_DELETE_RESULT event is now handled directly within the main event loop, using the new deleteMessageByMid function.
- Old message deletion logic and associated error handling have been removed.

- `ChatActivity.kt`:
- The opWorker is started in onCreate.
- All direct modifications to the messages list (messages.add, messages.add(0, ...)) are replaced with calls to the new queue functions (Handlers.addMessage, Handlers.addMessageFront).

- `SocketService.kt`:
- The messagesCache is now cleared during reconnection to ensure fresh data.
- Minor adjustments to Thread.sleep durations.

Signed-off-by: NikkaGames <[email protected]> by NikkaGames
f2d1bde: Refactor incoming message handling

Move notification logic from ComuFirebaseService to Handlers.
Remove messageCheck polling thread and handle messages directly in socket listener.
Update references for stacked notifications and remove obsolete background checks.

Signed-off-by: NikkaGames <[email protected]> by NikkaGames
🔨 1 new commit to ComuServer:main:

a277693: Refactor payload delivery logic for TCP and FCM fallback

Refactored the logic for sending payloads to user sessions, introducing sentTcp and selfTcp flags to track TCP delivery success. Added fallback to FCM if TCP delivery fails for all sessions. Improved thread management by replacing thread creation with ThreadPool.QueueUserWorkItem for FCM notifications. Ensured SslStream authentication before TCP data transmission. Streamlined exception handling, replaced for loops with foreach for clarity, and restructured code for better readability and maintainability. by NikkaGames
🔨 1 new commit to ComuServer:main:

288c8c2: Add async servers and enhanced debug logging

Replaced direct server invocations with asynchronous `Task`-based
execution for TCPServer and UdpServer, ensuring concurrent
operation. Introduced Task.WaitAll to synchronize completion.

Enhanced debug logging across RealtimeRegistry, TCPServer,
and UdpServer, controlled by the static TCPServer.sr flag.
Logs now include detailed insights into client registration,
packet handling, and room management.

Refactored UdpServer.Main into Run for task-based execution
and added a Dbg method for conditional logging. Improved
maintainability and debugging for real-time communication. by NikkaGames