Skip to content

Commit ee3b92f

Browse files
authored
Merge pull request #303 from Rustmail/301-display-the-person-who-closed-the-ticket-in-logs
refactor(close): add the staff who closed the ticket in close log message
2 parents 9a91aca + b58abaf commit ee3b92f

4 files changed

Lines changed: 4 additions & 2 deletions

File tree

rustmail/src/commands/close/slash_command/close.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,7 @@ impl RegistrableCommand for CloseCommand {
355355
let panel_url = format!("{}/panel/tickets/{}", base_url, thread.id);
356356

357357
let mut params = HashMap::new();
358+
params.insert("staff".to_string(), command.user.id.to_string());
358359
params.insert("username".to_string(), thread.user_name.clone());
359360
params.insert("user_id".to_string(), thread.user_id.to_string());
360361
params.insert("panel_url".to_string(), panel_url);

rustmail/src/commands/close/text_command/close.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ pub async fn close(
295295
let panel_url = format!("{}/panel/tickets/{}", base_url, thread.id);
296296

297297
let mut params = HashMap::new();
298+
params.insert("staff".to_string(), msg.author.id.to_string());
298299
params.insert("username".to_string(), thread.user_name.clone());
299300
params.insert("user_id".to_string(), thread.user_id.to_string());
300301
params.insert("panel_url".to_string(), panel_url);

rustmail/src/i18n/language/en.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ pub fn load_english_messages(dict: &mut ErrorDictionary) {
640640
);
641641
dict.messages.insert(
642642
"logs.ticket_closed".to_string(),
643-
DictionaryMessage::new("Ticket closed for user **{username}** (ID: {user_id})\n[View log on panel]({panel_url})"),
643+
DictionaryMessage::new("Ticket closed by <@{staff}> for user **{username}** (ID: {user_id})\n[View log on panel]({panel_url})"),
644644
);
645645
dict.messages.insert(
646646
"feature.not_implemented".to_string(),

rustmail/src/i18n/language/fr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ pub fn load_french_messages(dict: &mut ErrorDictionary) {
662662
);
663663
dict.messages.insert(
664664
"logs.ticket_closed".to_string(),
665-
DictionaryMessage::new("Ticket fermé pour l'utilisateur **{username}** (ID: {user_id})\n[Voir le log sur le panel]({panel_url})"),
665+
DictionaryMessage::new("Ticket fermé par <@{staff}> pour l'utilisateur **{username}** (ID: {user_id})\n[Voir le log sur le panel]({panel_url})"),
666666
);
667667
dict.messages.insert(
668668
"feature.not_implemented".to_string(),

0 commit comments

Comments
 (0)