From 18566511c9bf1580dbd651a7f0455319b83f7085 Mon Sep 17 00:00:00 2001 From: nxshock Date: Sat, 10 Aug 2019 10:50:50 +0500 Subject: [PATCH] Remove duplicated code --- internal/models/events/events.go | 15 --------------- internal/models/rooms/rooms.go | 4 +--- 2 files changed, 1 insertion(+), 18 deletions(-) delete mode 100644 internal/models/events/events.go diff --git a/internal/models/events/events.go b/internal/models/events/events.go deleted file mode 100644 index 6c45562..0000000 --- a/internal/models/events/events.go +++ /dev/null @@ -1,15 +0,0 @@ -package events - -import ( - "encoding/json" -) - -// Type is type of event -type Type string - -// Event is the basic set of fields all events must have -// https://matrix.org/docs/spec/client_server/latest#event-fields -type Event struct { - Content json.RawMessage `json:"content"` // Required. The fields in this object will vary depending on the type of event. When interacting with the REST API, this is the HTTP body. - Type Type `json:"type"` // Required. The type of event. This SHOULD be namespaced similar to Java package naming conventions e.g. 'com.example.subdomain.event.type' -} diff --git a/internal/models/rooms/rooms.go b/internal/models/rooms/rooms.go index 185c261..925bee2 100644 --- a/internal/models/rooms/rooms.go +++ b/internal/models/rooms/rooms.go @@ -4,8 +4,6 @@ import ( "encoding/json" "github.com/signaller-matrix/signaller/internal/models/common" - - "github.com/signaller-matrix/signaller/internal/models/events" ) type JoinRule string @@ -30,6 +28,6 @@ type Event struct { type UnsignedData struct { Age int `json:"age"` // The time in milliseconds that has elapsed since the event was sent. This field is generated by the local homeserver, and may be incorrect if the local time on at least one of the two servers is out of sync, which can cause the age to either be negative or greater than it actually is. - RedactedBecause events.Event `json:"redacted_because,omitempty"` // Optional. The event that redacted this event, if any. + RedactedBecause common.Event `json:"redacted_because,omitempty"` // Optional. The event that redacted this event, if any. TransactionID string `json:"transaction_id"` // The client-supplied transaction ID, if the client being given the event is the same one which sent it. }