From bdc30e57a56383990051afda781b8a1cc12fcf4f Mon Sep 17 00:00:00 2001 From: Till Faelligen Date: Sat, 31 Jul 2021 16:26:15 +0200 Subject: [PATCH] Test --- eduserver/api/output.go | 3 +++ federationapi/routing/send.go | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/eduserver/api/output.go b/eduserver/api/output.go index 2fbc08b54..0efe0b732 100644 --- a/eduserver/api/output.go +++ b/eduserver/api/output.go @@ -97,3 +97,6 @@ type OutputPresenceData struct { LastActiveAgo int64 `json:"last_active_ago,omitempty"` StreamPos types2.StreamPosition `json:"stream_pos"` } + +type FederationPresenceData struct { +} diff --git a/federationapi/routing/send.go b/federationapi/routing/send.go index 5f214e0fc..cb4bc345d 100644 --- a/federationapi/routing/send.go +++ b/federationapi/routing/send.go @@ -502,6 +502,13 @@ func (t *txnReq) processEDUs(ctx context.Context) { } } } + case gomatrixserverlib.MPresence: + payload := eduserverAPI.FederationPresenceData{} + util.GetLogger(ctx).Debug("%s", e.Content) + if err := json.Unmarshal(e.Content, &payload); err != nil { + util.GetLogger(ctx).WithError(err).Error("Failed to unmarshal presence event") + continue + } default: util.GetLogger(ctx).WithField("type", e.Type).Debug("Unhandled EDU") }