Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions event/renderer.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/matrix-org/gomatrixserverlib"
)

type messageEventContent struct {
type MessageEventContent struct {
Body string `json:"body"`
Msgtype string `json:"msgtype"`
FormattedBody string `json:"formatted_body"`
Expand All @@ -25,7 +25,7 @@ type reactionEventContent struct {
func RenderToText(event gomatrixserverlib.PDU) ([]string, error) {
switch event.Type() {
case "m.room.message":
content := &messageEventContent{}
content := &MessageEventContent{}
err := json.Unmarshal(event.Content(), &content)
if err != nil {
return nil, err
Expand Down
3 changes: 2 additions & 1 deletion filter/filter_keyword_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"log"
"time"

"github.com/matrix-org/policyserv/event"
"github.com/matrix-org/policyserv/filter/classification"
"github.com/matrix-org/policyserv/internal"
"github.com/matrix-org/policyserv/pslib"
Expand Down Expand Up @@ -66,7 +67,7 @@ func (f *InstancedKeywordTemplateFilter) CheckEvent(ctx context.Context, input *
return nil, nil
}

content := &messageEventContent{}
content := &event.MessageEventContent{}
err := json.Unmarshal(input.Event.Content(), &content)
if err != nil {
// Probably not a string
Expand Down