Add possibility to specify contacts for `-l`.

v0.2
Martin Dosch 2 years ago
parent ed94bdb0b7
commit dbc42c6cb8

@ -428,10 +428,21 @@ func main() {
log.Println(err)
}
switch v := received.(type) {
switch v := received.(type) {
case xmpp.Chat:
if v.Text != "" {
if v.Text == "" {
continue
}
// Print any messages if no recipients are specified
if len(recipients) == 0 {
fmt.Println(v.Text)
} else {
bareFrom := strings.Split(v.Remote, "/")[0]
for _, recipient := range recipients {
if bareFrom == strings.ToLower(recipient) {
fmt.Println(v.Text)
}
}
}
default:
continue

Loading…
Cancel
Save