Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block exchanges between user A to B #630

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

jgosmus
Copy link
Contributor

@jgosmus jgosmus commented Jan 26, 2025

This PR closes #438

Sorry for being late!

I migrated the feature to TS, I didn't split the PR because it's difficult for me to split it in different but usable PR.

I'm open to feedback / suggestions for improvements or bugs

Summary by CodeRabbit

Release Notes: User Blocking Feature

  • New Features

    • Added user blocking functionality in the Telegram bot
    • Users can now block and unblock other users
    • Implemented blocklist management
    • Added restrictions on order interactions for blocked users
  • Improvements

    • Enhanced user interaction controls
    • Added multilingual support for blocking messages
    • Improved order processing validation
  • Localization

    • Added blocking-related messages in multiple languages (German, English, Spanish, French, Italian, Korean, Portuguese, Russian, Ukrainian)

@grunch grunch requested a review from Catrya January 28, 2025 11:47
@grunch
Copy link
Member

grunch commented Jan 28, 2025

@coderabbitai review

Copy link

coderabbitai bot commented Jan 28, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link

coderabbitai bot commented Jan 28, 2025

Walkthrough

This pull request introduces a comprehensive user blocking feature for the Telegram bot. The changes span multiple files across different modules, adding functionality to block and unblock users, check blocking status, and prevent order interactions between blocked users. The implementation includes new models, message handling, command configurations, and localized messages across multiple languages to support user blocking scenarios.

Changes

File Change Summary
bot/messages.ts Added two async functions for sending messages about blocked order scenarios
bot/modules/block/... Created new module for handling user blocking with commands, context, messages, and configuration
bot/modules/orders/takeOrder.js Enhanced order-taking logic to check blocking status between users
bot/start.ts Imported and configured new BlockModule
models/block.ts Created new Mongoose model for tracking user blocks
models/index.ts Added Block model to exported entities
locales/*.yaml Added localized messages for user blocking across multiple languages

Poem

🐰 Blocking bunnies, oh what fun!
No more orders when you're on the run
Telegram's new feature so bright
Keeping interactions just right
A rabbit's guard, both swift and neat 🚫

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 17

🧹 Nitpick comments (4)
bot/modules/block/customContext.ts (1)

3-9: Add JSDoc comments to document the interface.

Adding documentation will help other developers understand the purpose and usage of this interface.

+/**
+ * Extended context for block-related commands.
+ * Adds user information and internationalization support.
+ */
 export interface CustomContext extends Context {
   user?: {
     id: string;
     tg_id: string;
   },
   i18n?: any;
 }
models/block.ts (1)

3-7: Add JSDoc comments to document the interface.

Adding documentation will help other developers understand the purpose and usage of this interface.

+/**
+ * Represents a block relationship between two users.
+ * @interface IBlock
+ */
 export interface IBlock extends Document {
   blocker_tg_id: string;
   blocked_tg_id: string;
   created_at: Date;
 }
bot/modules/block/index.ts (1)

3-4: Use ES6 imports instead of require.

For better type safety and consistency with TypeScript, use ES6 imports.

-const commands = require('./commands');
-const { userMiddleware } = require('../../middleware/user');
+import * as commands from './commands';
+import { userMiddleware } from '../../middleware/user';
bot/modules/block/messages.ts (1)

6-12: Improve error handling by notifying the user.

The function should notify the user when message sending fails, rather than silently logging the error.

Apply this diff to improve error handling:

 const ordersInProcess = async (ctx: CustomContext) => {
   try {
     ctx.reply(ctx.i18n.t('orders_in_process'));
   } catch (error) {
     logger.error(error);
+    await ctx.reply(ctx.i18n.t('error_sending_message')).catch(() => {});
   }
 };
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 27d31b5 and 7e4a4c8.

📒 Files selected for processing (19)
  • bot/messages.ts (2 hunks)
  • bot/modules/block/commands.ts (1 hunks)
  • bot/modules/block/customContext.ts (1 hunks)
  • bot/modules/block/index.ts (1 hunks)
  • bot/modules/block/messages.ts (1 hunks)
  • bot/modules/orders/takeOrder.js (3 hunks)
  • bot/start.ts (2 hunks)
  • locales/de.yaml (1 hunks)
  • locales/en.yaml (1 hunks)
  • locales/es.yaml (1 hunks)
  • locales/fa.yaml (1 hunks)
  • locales/fr.yaml (1 hunks)
  • locales/it.yaml (1 hunks)
  • locales/ko.yaml (1 hunks)
  • locales/pt.yaml (1 hunks)
  • locales/ru.yaml (1 hunks)
  • locales/uk.yaml (1 hunks)
  • models/block.ts (1 hunks)
  • models/index.ts (2 hunks)
🔇 Additional comments (14)
models/index.ts (1)

7-7: LGTM!

The Block model import and export follow the established pattern in the file.

Also applies to: 16-16

bot/modules/block/messages.ts (4)

14-20: Same error handling issue as in ordersInProcess.


22-28: Same error handling issue as in ordersInProcess.


30-36: Same error handling issue as in ordersInProcess.


47-53: Same error handling issue as in ordersInProcess.

bot/modules/orders/takeOrder.js (1)

89-99: Same code duplication issue as in takebuy.

bot/start.ts (1)

32-32: LGTM!

The BlockModule is correctly imported and configured in the appropriate order.

Also applies to: 261-261

bot/messages.ts (1)

758-778: LGTM! Well-structured blocking notification functions.

The new functions follow consistent patterns with proper error handling, clear naming, and correct typing.

locales/ko.yaml (1)

632-638: LGTM! Clear and consistent blocking-related messages.

The messages provide clear user feedback for various blocking scenarios and align well with the blocking feature implementation.

locales/ru.yaml (1)

637-643: LGTM! Clear and consistent blocking-related messages.

The messages provide clear user feedback for various blocking scenarios and align well with the blocking feature implementation.

locales/uk.yaml (1)

633-639: LGTM! Ukrainian translations for user blocking functionality.

The translations are accurate and maintain consistent meaning with other locale files. All required messages for the blocking feature are present.

locales/en.yaml (1)

638-644: LGTM! Base English messages for user blocking functionality.

The messages are clear, concise, and provide good user feedback for the blocking feature.

locales/es.yaml (1)

637-643: LGTM! Spanish translations are accurate and well-formatted.

The translations maintain consistent meaning with other language versions while using natural Spanish expressions.

locales/de.yaml (1)

637-643: LGTM! The message structure is complete and consistent.

The messages cover all necessary user interactions for the blocking feature and follow a consistent style with other messages in the file.

id: string;
tg_id: string;
},
i18n?: any;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Replace any type with a more specific type for i18n.

Using any type reduces type safety. Consider defining a proper interface for the i18n object to catch potential type-related issues at compile time.

-  i18n?: any;
+  i18n?: {
+    t: (key: string, params?: Record<string, unknown>) => string;
+  };
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
i18n?: any;
i18n?: {
t: (key: string, params?: Record<string, unknown>) => string;
};

Comment on lines +9 to +13
const blockSchema = new Schema<IBlock>({
blocker_tg_id: { type: String },
blocked_tg_id: { type: String },
created_at: { type: Date, default: Date.now },
});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add indexes and field validation to the schema.

The current schema could benefit from:

  1. Adding required field validation
  2. Adding indexes for efficient querying
  3. Adding a unique compound index to prevent duplicate blocks
 const blockSchema = new Schema<IBlock>({
-  blocker_tg_id: { type: String },
-  blocked_tg_id: { type: String },
+  blocker_tg_id: { type: String, required: true, index: true },
+  blocked_tg_id: { type: String, required: true, index: true },
   created_at: { type: Date, default: Date.now },
 });
+
+// Prevent duplicate blocks
+blockSchema.index({ blocker_tg_id: 1, blocked_tg_id: 1 }, { unique: true });
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const blockSchema = new Schema<IBlock>({
blocker_tg_id: { type: String },
blocked_tg_id: { type: String },
created_at: { type: Date, default: Date.now },
});
const blockSchema = new Schema<IBlock>({
blocker_tg_id: { type: String, required: true, index: true },
blocked_tg_id: { type: String, required: true, index: true },
created_at: { type: Date, default: Date.now },
});
// Prevent duplicate blocks
blockSchema.index({ blocker_tg_id: 1, blocked_tg_id: 1 }, { unique: true });

if (args.length !== 2) return next();
commands.unblock(ctx, args[1]);
});
bot.command('blocklist', userMiddleware, commands.blocklist);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add error handling to blocklist command.

Wrap the command execution in try-catch.

-  bot.command('blocklist', userMiddleware, commands.blocklist);
+  bot.command('blocklist', userMiddleware, rateLimiter, async (ctx: CustomContext) => {
+    try {
+      await commands.blocklist(ctx);
+    } catch (error) {
+      console.error('Error in blocklist command:', error);
+      await ctx.reply(ctx.i18n?.t('blocklist_error') ?? 'Failed to fetch block list');
+    }
+  });
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
bot.command('blocklist', userMiddleware, commands.blocklist);
bot.command('blocklist', userMiddleware, rateLimiter, async (ctx: CustomContext) => {
try {
await commands.blocklist(ctx);
} catch (error) {
console.error('Error in blocklist command:', error);
await ctx.reply(ctx.i18n?.t('blocklist_error') ?? 'Failed to fetch block list');
}
});

Comment on lines +13 to +17
bot.command('unblock', userMiddleware, async (ctx, next) => {
const args = ctx.message.text.split(' ') || [];
if (args.length !== 2) return next();
commands.unblock(ctx, args[1]);
});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add error handling and input validation to unblock command.

Apply the same improvements as the block command.

-  bot.command('unblock', userMiddleware, async (ctx, next) => {
+  bot.command('unblock', userMiddleware, rateLimiter, async (ctx: CustomContext, next) => {
     const args = ctx.message.text.split(' ') || [];
     if (args.length !== 2) return next();
-    commands.unblock(ctx, args[1]);
+    const username = args[1];
+    if (!username.match(/^@?[\w\d]{5,32}$/)) {
+      await ctx.reply(ctx.i18n?.t('invalid_username_format') ?? 'Invalid username format');
+      return;
+    }
+    try {
+      await commands.unblock(ctx, username);
+    } catch (error) {
+      console.error('Error in unblock command:', error);
+      await ctx.reply(ctx.i18n?.t('unblock_error') ?? 'Failed to unblock user');
+    }
   });
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
bot.command('unblock', userMiddleware, async (ctx, next) => {
const args = ctx.message.text.split(' ') || [];
if (args.length !== 2) return next();
commands.unblock(ctx, args[1]);
});
bot.command('unblock', userMiddleware, rateLimiter, async (ctx: CustomContext, next) => {
const args = ctx.message.text.split(' ') || [];
if (args.length !== 2) return next();
const username = args[1];
if (!username.match(/^@?[\w\d]{5,32}$/)) {
await ctx.reply(ctx.i18n?.t('invalid_username_format') ?? 'Invalid username format');
return;
}
try {
await commands.unblock(ctx, username);
} catch (error) {
console.error('Error in unblock command:', error);
await ctx.reply(ctx.i18n?.t('unblock_error') ?? 'Failed to unblock user');
}
});

Comment on lines +7 to +11
bot.command('block', userMiddleware, async (ctx, next) => {
const args = ctx.message.text.split(' ') || [];
if (args.length !== 2) return next();
commands.block(ctx, args[1]);
});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add error handling and input validation.

The command handler should:

  1. Include try-catch for error handling
  2. Validate username format
  3. Add rate limiting to prevent abuse
-  bot.command('block', userMiddleware, async (ctx, next) => {
+  bot.command('block', userMiddleware, rateLimiter, async (ctx: CustomContext, next) => {
     const args = ctx.message.text.split(' ') || [];
     if (args.length !== 2) return next();
-    commands.block(ctx, args[1]);
+    const username = args[1];
+    if (!username.match(/^@?[\w\d]{5,32}$/)) {
+      await ctx.reply(ctx.i18n?.t('invalid_username_format') ?? 'Invalid username format');
+      return;
+    }
+    try {
+      await commands.block(ctx, username);
+    } catch (error) {
+      console.error('Error in block command:', error);
+      await ctx.reply(ctx.i18n?.t('block_error') ?? 'Failed to block user');
+    }
   });

Committable suggestion skipped: line range outside the PR's diff.

Comment on lines +636 to +642
user_already_blocked: User is already blocked
user_blocked: User successfully blocked
user_unblocked: User successfully unblocked
blocklist_empty: You do not have any blocked user
orders_in_process: There are orders in process with this user
user_order_is_blocked_by_user_taker: You can't take this order because you blocked its maker
user_taker_is_blocked_by_user_order: You can't take this order because its maker blocked you
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Translate blocking messages to Persian/Farsi.

The new blocking-related messages are currently in English and need to be translated to Persian/Farsi to maintain consistency with the rest of the locale file.

Comment on lines +634 to +640
user_already_blocked: User is already blocked
user_blocked: User successfully blocked
user_unblocked: User successfully unblocked
blocklist_empty: You do not have any blocked user
orders_in_process: There are orders in process with this user
user_order_is_blocked_by_user_taker: You can't take this order because you blocked its maker
user_taker_is_blocked_by_user_order: You can't take this order because its maker blocked you
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Missing Portuguese translations for user blocking messages.

The new messages are currently in English and need to be translated to Portuguese to maintain consistency with the rest of the file.

Here are the messages that need translation:

-user_already_blocked: User is already blocked
-user_blocked: User successfully blocked
-user_unblocked: User successfully unblocked
-blocklist_empty: You do not have any blocked user
-orders_in_process: There are orders in process with this user
-user_order_is_blocked_by_user_taker: You can't take this order because you blocked its maker
-user_taker_is_blocked_by_user_order: You can't take this order because its maker blocked you
+user_already_blocked: Usuário já está bloqueado
+user_blocked: Usuário bloqueado com sucesso
+user_unblocked: Usuário desbloqueado com sucesso
+blocklist_empty: Você não tem nenhum usuário bloqueado
+orders_in_process: Existem ordens em andamento com este usuário
+user_order_is_blocked_by_user_taker: Você não pode aceitar esta oferta porque bloqueou seu criador
+user_taker_is_blocked_by_user_order: Você não pode aceitar esta oferta porque seu criador bloqueou você
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
user_already_blocked: User is already blocked
user_blocked: User successfully blocked
user_unblocked: User successfully unblocked
blocklist_empty: You do not have any blocked user
orders_in_process: There are orders in process with this user
user_order_is_blocked_by_user_taker: You can't take this order because you blocked its maker
user_taker_is_blocked_by_user_order: You can't take this order because its maker blocked you
user_already_blocked: Usuário já está bloqueado
user_blocked: Usuário bloqueado com sucesso
user_unblocked: Usuário desbloqueado com sucesso
blocklist_empty: Você não tem nenhum usuário bloqueado
orders_in_process: Existem ordens em andamento com este usuário
user_order_is_blocked_by_user_taker: Você não pode aceitar esta oferta porque bloqueou seu criador
user_taker_is_blocked_by_user_order: Você não pode aceitar esta oferta porque seu criador bloqueou você

Comment on lines +634 to +640
user_already_blocked: User is already blocked
user_blocked: User successfully blocked
user_unblocked: User successfully unblocked
blocklist_empty: You do not have any blocked user
orders_in_process: There are orders in process with this user
user_order_is_blocked_by_user_taker: You can't take this order because you blocked its maker
user_taker_is_blocked_by_user_order: You can't take this order because its maker blocked you
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Missing Italian translations for user blocking messages.

The new messages are currently in English and need to be translated to Italian to maintain consistency with the rest of the file.

Here are the messages that need translation:

-user_already_blocked: User is already blocked
-user_blocked: User successfully blocked
-user_unblocked: User successfully unblocked
-blocklist_empty: You do not have any blocked user
-orders_in_process: There are orders in process with this user
-user_order_is_blocked_by_user_taker: You can't take this order because you blocked its maker
-user_taker_is_blocked_by_user_order: You can't take this order because its maker blocked you
+user_already_blocked: L'utente è già bloccato
+user_blocked: Utente bloccato con successo
+user_unblocked: Utente sbloccato con successo
+blocklist_empty: Non hai alcun utente bloccato
+orders_in_process: Ci sono ordini in corso con questo utente
+user_order_is_blocked_by_user_taker: Non puoi accettare questo ordine perché hai bloccato il suo creatore
+user_taker_is_blocked_by_user_order: Non puoi accettare questo ordine perché il suo creatore ti ha bloccato
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
user_already_blocked: User is already blocked
user_blocked: User successfully blocked
user_unblocked: User successfully unblocked
blocklist_empty: You do not have any blocked user
orders_in_process: There are orders in process with this user
user_order_is_blocked_by_user_taker: You can't take this order because you blocked its maker
user_taker_is_blocked_by_user_order: You can't take this order because its maker blocked you
user_already_blocked: L'utente è già bloccato
user_blocked: Utente bloccato con successo
user_unblocked: Utente sbloccato con successo
blocklist_empty: Non hai alcun utente bloccato
orders_in_process: Ci sono ordini in corso con questo utente
user_order_is_blocked_by_user_taker: Non puoi accettare questo ordine perché hai bloccato il suo creatore
user_taker_is_blocked_by_user_order: Non puoi accettare questo ordine perché il suo creatore ti ha bloccato

Comment on lines +636 to +642
user_already_blocked: User is already blocked
user_blocked: User successfully blocked
user_unblocked: User successfully unblocked
blocklist_empty: You do not have any blocked user
orders_in_process: There are orders in process with this user
user_order_is_blocked_by_user_taker: You can't take this order because you blocked its maker
user_taker_is_blocked_by_user_order: You can't take this order because its maker blocked you
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Missing French translations for user blocking messages.

The new messages are currently in English and need to be translated to French to maintain consistency with the rest of the file.

Here are the messages that need translation:

-user_already_blocked: User is already blocked
-user_blocked: User successfully blocked
-user_unblocked: User successfully unblocked
-blocklist_empty: You do not have any blocked user
-orders_in_process: There are orders in process with this user
-user_order_is_blocked_by_user_taker: You can't take this order because you blocked its maker
-user_taker_is_blocked_by_user_order: You can't take this order because its maker blocked you
+user_already_blocked: L'utilisateur est déjà bloqué
+user_blocked: Utilisateur bloqué avec succès
+user_unblocked: Utilisateur débloqué avec succès
+blocklist_empty: Vous n'avez aucun utilisateur bloqué
+orders_in_process: Il y a des ordres en cours avec cet utilisateur
+user_order_is_blocked_by_user_taker: Vous ne pouvez pas accepter cette offre car vous avez bloqué son créateur
+user_taker_is_blocked_by_user_order: Vous ne pouvez pas accepter cette offre car son créateur vous a bloqué
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
user_already_blocked: User is already blocked
user_blocked: User successfully blocked
user_unblocked: User successfully unblocked
blocklist_empty: You do not have any blocked user
orders_in_process: There are orders in process with this user
user_order_is_blocked_by_user_taker: You can't take this order because you blocked its maker
user_taker_is_blocked_by_user_order: You can't take this order because its maker blocked you
user_already_blocked: L'utilisateur est déjà bloqué
user_blocked: Utilisateur bloqué avec succès
user_unblocked: Utilisateur débloqué avec succès
blocklist_empty: Vous n'avez aucun utilisateur bloqué
orders_in_process: Il y a des ordres en cours avec cet utilisateur
user_order_is_blocked_by_user_taker: Vous ne pouvez pas accepter cette offre car vous avez bloqué son créateur
user_taker_is_blocked_by_user_order: Vous ne pouvez pas accepter cette offre car son créateur vous a bloqué

Comment on lines +637 to +643
user_already_blocked: User is already blocked
user_blocked: User successfully blocked
user_unblocked: User successfully unblocked
blocklist_empty: You do not have any blocked user
orders_in_process: There are orders in process with this user
user_order_is_blocked_by_user_taker: You can't take this order because you blocked its maker
user_taker_is_blocked_by_user_order: You can't take this order because its maker blocked you
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Translate the new messages to German to maintain consistency.

The new messages for user blocking functionality are in English while this file is for German translations.

Apply this diff to add German translations:

-user_already_blocked: User is already blocked
-user_blocked: User successfully blocked
-user_unblocked: User successfully unblocked
-blocklist_empty: You do not have any blocked user
-orders_in_process: There are orders in process with this user
-user_order_is_blocked_by_user_taker: You can't take this order because you blocked its maker
-user_taker_is_blocked_by_user_order: You can't take this order because its maker blocked you
+user_already_blocked: Benutzer ist bereits gesperrt
+user_blocked: Benutzer erfolgreich gesperrt
+user_unblocked: Benutzer erfolgreich entsperrt
+blocklist_empty: Du hast keine gesperrten Benutzer
+orders_in_process: Es gibt laufende Aufträge mit diesem Benutzer
+user_order_is_blocked_by_user_taker: Du kannst diesen Auftrag nicht annehmen, da du seinen Ersteller gesperrt hast
+user_taker_is_blocked_by_user_order: Du kannst diesen Auftrag nicht annehmen, da dich sein Ersteller gesperrt hat
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
user_already_blocked: User is already blocked
user_blocked: User successfully blocked
user_unblocked: User successfully unblocked
blocklist_empty: You do not have any blocked user
orders_in_process: There are orders in process with this user
user_order_is_blocked_by_user_taker: You can't take this order because you blocked its maker
user_taker_is_blocked_by_user_order: You can't take this order because its maker blocked you
user_already_blocked: Benutzer ist bereits gesperrt
user_blocked: Benutzer erfolgreich gesperrt
user_unblocked: Benutzer erfolgreich entsperrt
blocklist_empty: Du hast keine gesperrten Benutzer
orders_in_process: Es gibt laufende Aufträge mit diesem Benutzer
user_order_is_blocked_by_user_taker: Du kannst diesen Auftrag nicht annehmen, da du seinen Ersteller gesperrt hast
user_taker_is_blocked_by_user_order: Du kannst diesen Auftrag nicht annehmen, da dich sein Ersteller gesperrt hat

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.

Herramienta / Comando para impedir intercambios entre usuario A y B
2 participants