more tags

This commit is contained in:
Adrian Malacoda 2017-05-10 02:16:05 -05:00
parent 2c0e5170f4
commit 97cc215f05

View File

@ -28,6 +28,7 @@ impl Envelope {
match &event {
&Event::Message { ref message } => {
tags.insert(String::from("type:message"));
tags.insert(format!("user:{:}", message.author.name));
match message.channel {
Some(ref channel) => {
@ -37,16 +38,20 @@ impl Envelope {
}
},
&Event::SelfJoin { ref channel } => {
tags.insert(String::from("type:selfjoin"));
tags.insert(format!("channel:{:}", channel.name));
},
&Event::SelfQuit { ref channel } => {
tags.insert(String::from("type:selfquit"));
tags.insert(format!("channel:{:}", channel.name));
},
&Event::UserJoin { ref channel, ref user } => {
tags.insert(String::from("type:userjoin"));
tags.insert(format!("channel:{:}", channel.name));
tags.insert(format!("user:{:}", user.name));
},
&Event::UserQuit { ref channel, ref user } => {
tags.insert(String::from("type:userquit"));
tags.insert(format!("channel:{:}", channel.name));
tags.insert(format!("user:{:}", user.name));
}