forked from jshiffer/matterbridge
Do not relay empty or delayed messages (xmpp)
This commit is contained in:
parent
6c018ee6fe
commit
4960273832
@ -98,6 +98,7 @@ func (b *Bxmpp) xmppKeepAlive() chan bool {
|
|||||||
func (b *Bxmpp) handleXmpp() error {
|
func (b *Bxmpp) handleXmpp() error {
|
||||||
done := b.xmppKeepAlive()
|
done := b.xmppKeepAlive()
|
||||||
defer close(done)
|
defer close(done)
|
||||||
|
nodelay := time.Time{}
|
||||||
for {
|
for {
|
||||||
m, err := b.xc.Recv()
|
m, err := b.xc.Recv()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -115,7 +116,7 @@ func (b *Bxmpp) handleXmpp() error {
|
|||||||
if len(s) == 2 {
|
if len(s) == 2 {
|
||||||
nick = s[1]
|
nick = s[1]
|
||||||
}
|
}
|
||||||
if nick != b.Config.Nick {
|
if nick != b.Config.Nick && v.Stamp == nodelay && v.Text != "" {
|
||||||
flog.Debugf("Sending message from %s on %s to gateway", nick, b.Account)
|
flog.Debugf("Sending message from %s on %s to gateway", nick, b.Account)
|
||||||
b.Remote <- config.Message{Username: nick, Text: v.Text, Channel: channel, Account: b.Account}
|
b.Remote <- config.Message{Username: nick, Text: v.Text, Channel: channel, Account: b.Account}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user