fix phonebook duplicates
This commit is contained in:
parent
c787e7caf4
commit
52d962a6bb
|
@ -1025,8 +1025,11 @@ pub fn handle_chat_scripts(
|
|||
}
|
||||
"registercontact" => {
|
||||
if CONTACTS.contains(¶m1) {
|
||||
prefs.contacts.push(param1.to_string());
|
||||
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.");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue