diff --git a/src/chat.rs b/src/chat.rs index 945d2b0..964e423 100644 --- a/src/chat.rs +++ b/src/chat.rs @@ -1025,8 +1025,11 @@ pub fn handle_chat_scripts( } "registercontact" => { if CONTACTS.contains(¶m1) { - prefs.contacts.push(param1.to_string()); - prefs.save(); + let param1_string = param1.to_string(); + if !prefs.contacts.contains(¶m1_string) { + prefs.contacts.push(param1_string); + prefs.save(); + } } else { error!("Can't register contact `{param1}', it doesn't exist in the chat::CONTACTS constant."); }