From f2739ea81f8da968adf34b7a2e9bd454a3463cb7 Mon Sep 17 00:00:00 2001 From: Martin/Geno Date: Mon, 3 Jun 2019 00:02:18 +0200 Subject: [PATCH] [BUGFIX] error received message --- component/threema/receive.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/component/threema/receive.go b/component/threema/receive.go index 36167d9..2790cb2 100644 --- a/component/threema/receive.go +++ b/component/threema/receive.go @@ -12,6 +12,13 @@ import ( func (a *Account) receiver(out chan<- xmpp.Packet) { for receivedMessage := range a.receive { + if receivedMessage.Err != nil { + log.Warnf("Error Receiving Message: %s\n", receivedMessage.Err) + xMSG := xmpp.NewMessage("chat", "", a.XMPP.String(), "", "en") + xMSG.Body = fmt.Sprintf("error on decoding message:\n%v", receivedMessage.Err) + out <- xMSG + continue + } sender := receivedMessage.Msg.Sender().String() if string(a.TID) == sender { continue @@ -32,10 +39,6 @@ func requestExtensions(xMSG *xmpp.Message) { } func (a *Account) receiving(receivedMessage o3.ReceivedMsg) (xmpp.Packet, error) { - if receivedMessage.Err != nil { - log.Warnf("Error Receiving Message: %s\n", receivedMessage.Err) - return nil, receivedMessage.Err - } switch msg := receivedMessage.Msg.(type) { case o3.TextMessage: sender := msg.Sender().String()