aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/url.rs14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/plugins/url.rs b/src/plugins/url.rs
index d769a0b..9724d70 100644
--- a/src/plugins/url.rs
+++ b/src/plugins/url.rs
@@ -162,12 +162,14 @@ impl Plugin for UrlTitles {
fn execute_threaded(&self, client: &IrcClient, message: &Message) -> Result<(), FrippyError> {
match message.command {
- Command::PRIVMSG(_, ref content) => match self.url(content) {
- Ok(title) => client
- .send_privmsg(message.response_target().unwrap(), &title)
- .context(FrippyErrorKind::Connection)?,
- Err(e) => Err(e).context(FrippyErrorKind::Url)?,
- },
+ Command::PRIVMSG(_, ref content) => {
+ let title = self.url(content).context(FrippyErrorKind::Url)?;
+ let response = format!("[URL] {}", title);
+
+ client
+ .send_privmsg(message.response_target().unwrap(), &response)
+ .context(FrippyErrorKind::Connection)?;
+ }
_ => (),
}