Skip to content

Conversation

@LifeRIP
Copy link
Contributor

@LifeRIP LifeRIP commented Jun 24, 2025

This pull request introduces updates to the DirectChatRepository and ModerationService to improve functionality and enforce stricter validation rules. The key changes include refactoring the logic for fetching user display names in direct chats, adding a new dependency to the ModerationService, and implementing additional checks for reporting messages.

Updates to DirectChatRepository:

  • Refactored the logic for fetching user display names in direct chats to handle exactly two users. This includes retrieving display names for both users, assigning "Usuario Desconocido" if a user is not found, and swapping names and IDs to ensure the current user always appears second.

Updates to ModerationService:

  • Added a new dependency, roomService, to ModerationService to enable room-related operations. [1] [2]
  • Enhanced the ReportMessage method to include:
    • A check to prevent banned users from reporting messages.
    • A validation to disallow reporting messages from admins or the room owner, with appropriate error handling.

LifeRIP added 2 commits June 24, 2025 13:07
- Prevents banned users from reporting messages and disallows reporting messages from admins or room owners.
- Introduces a dependency on `RoomService` to verify user privileges and enforces stricter validation for reporting logic.
- Optimizes the retrieval of user display names by handling only two users per direct chat.
- Adds fallback names for unknown users and ensures the current user is always second in the order.
- Enhances clarity and consistency in user identification for direct chats.
@LifeRIP LifeRIP merged commit a79585d into develop Jun 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants