mirror of
https://mau.dev/mautrix/go.git
synced 2026-03-14 14:25:53 +01:00
Improve debug log for unsupported event types and add call events to GuessClass (ref #32)
This commit is contained in:
parent
eef0e65458
commit
42d0adaa7d
3 changed files with 9 additions and 8 deletions
|
|
@ -9,6 +9,7 @@ package appservice
|
|||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
|
@ -151,12 +152,10 @@ func (as *AppService) handleEvents(evts []*event.Event, typeClass event.TypeClas
|
|||
evt.Type.Class = event.MessageEventType
|
||||
}
|
||||
err := evt.Content.ParseRaw(evt.Type)
|
||||
if err != nil {
|
||||
if evt.ID != "" {
|
||||
as.Log.Debugfln("Failed to parse content of %s (%s): %v", evt.ID, evt.Type.Type, err)
|
||||
} else {
|
||||
as.Log.Debugfln("Failed to parse content of a %s: %v", evt.Type.Type, err)
|
||||
}
|
||||
if errors.Is(err, event.UnsupportedContentType) {
|
||||
as.Log.Debugfln("Not parsing content of %s: %v", evt.ID, err)
|
||||
} else if err != nil {
|
||||
as.Log.Debugfln("Failed to parse content of %s (type %s): %v", evt.ID, evt.Type.Type, err)
|
||||
}
|
||||
if evt.Type.IsState() {
|
||||
as.UpdateState(evt)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue