Added MONITOR command for IRCv3.2 monitor extension.
This commit is contained in:
parent
7d39a12142
commit
e9066e3cba
1 changed files with 15 additions and 0 deletions
|
@ -155,6 +155,10 @@ pub enum Command {
|
|||
// AWAY(Option<String>),
|
||||
// JOIN is already defined.
|
||||
// JOIN(String, Option<String>, Option<String>),
|
||||
|
||||
// IRCv3.2 extensions
|
||||
/// MONITOR command [nicklist]
|
||||
MONITOR(String, Option<String>)
|
||||
}
|
||||
|
||||
impl Into<Message> for Command {
|
||||
|
@ -326,6 +330,11 @@ impl Into<Message> for Command {
|
|||
|
||||
Command::ACCOUNT(a) =>
|
||||
Message::from_owned(None, string("ACCOUNT"), Some(vec![a]), None),
|
||||
|
||||
Command::MONITOR(c, Some(t)) =>
|
||||
Message::from_owned(None, string("MONITOR"), Some(vec![c, t]), None),
|
||||
Command::MONITOR(c, None) =>
|
||||
Message::from_owned(None, string("MONITOR"), Some(vec![c]), None),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1066,6 +1075,12 @@ impl Command {
|
|||
return Err(invalid_input())
|
||||
}
|
||||
}
|
||||
} else if let "MONITOR" = &m.command[..] {
|
||||
if m.args.len() == 1 {
|
||||
Command::MONITOR(m.args[0].clone(), m.suffix.clone())
|
||||
} else {
|
||||
return Err(invalid_input())
|
||||
}
|
||||
} else {
|
||||
return Err(invalid_input())
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue