Skip to main content

change_contact

Function change_contact 

Source
pub async fn change_contact(
    username: &str,
    contact: Option<&str>,
    database: Arc<Database>,
    trail: &impl OperatorTrail,
) -> Result<Option<(AdminUser, bool)>, UserError>
Expand description

Sets or clears username’s notification address.

An address set to what it already was writes no row and sends no message: telling somebody their alarms moved to the address they were already using is noise that teaches them to ignore the real one. Otherwise the message goes to the address the change replaced — whoever made the change controls the new one. The bool is whether anything changed; None when there is no such operator.