aboutsummaryrefslogtreecommitdiff
path: root/src/handlers/x500_mapper.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/handlers/x500_mapper.rs')
-rw-r--r--src/handlers/x500_mapper.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/handlers/x500_mapper.rs b/src/handlers/x500_mapper.rs
index 1ec35f2..acd498f 100644
--- a/src/handlers/x500_mapper.rs
+++ b/src/handlers/x500_mapper.rs
@@ -90,9 +90,9 @@ impl X500Mapper {
async fn record_x500(&self, ctx: &Context, member: Member, x500: String) {
let x500 = &x500;
- let uid = member.user.id;
+ let member = &member;
let future = async move {
- let uid = i64::from(uid);
+ let uid = i64::from(member.user.id);
sqlx::query!(
"INSERT OR IGNORE INTO all_seen_uids_to_x500s (uid, x500) VALUES (?, ?)",
uid,
@@ -112,8 +112,8 @@ impl X500Mapper {
.context("failed to insert into uids_to_x500s_clean")?;
if let Some(role) = self.config.students_role {
- log::info!("adding the role {} to {}", role, member.display_name());
if !member.roles.contains(&role) {
+ log::info!("adding the role {} to {:?}", role, member.display_name());
member
.add_role(&ctx.http, role)
.await
@@ -127,8 +127,9 @@ impl X500Mapper {
match future.await {
Ok(()) => (),
Err(err) => log::error!(
- "failed to record that the user with UID {} had the X.500 {}: {:?}",
- uid,
+ "failed to record that the user with UID {} ({:?}) had the X.500 {}: {:?}",
+ member.user.id,
+ member.display_name(),
x500,
err
),