improve account lookup
This commit is contained in:
@@ -46,21 +46,18 @@ impl<'a> ProcessMention<'a> {
|
||||
Err(e.into())
|
||||
}
|
||||
Ok(Ok(res)) => {
|
||||
debug!("Result: {:#?}", res);
|
||||
|
||||
if let Some(item) = res.accounts.into_iter().next() {
|
||||
for item in res.accounts {
|
||||
let acct_normalized = normalize_acct(&item.acct, &self.group_acct)?;
|
||||
if acct_normalized == acct {
|
||||
debug!("Search done, account found: {}", item.acct);
|
||||
Ok(Some(item.id))
|
||||
return Ok(Some(item.id))
|
||||
} else {
|
||||
warn!("Search done but found wrong account: {}", item.acct);
|
||||
Ok(None)
|
||||
warn!("Found wrong account: {}", item.acct);
|
||||
}
|
||||
} else {
|
||||
debug!("Search done, nothing found");
|
||||
Ok(None)
|
||||
}
|
||||
|
||||
debug!("Search done, nothing found");
|
||||
Ok(None)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user