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