summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/matterbridge/gomatrix/events.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/matterbridge/gomatrix/events.go')
-rw-r--r--vendor/github.com/matterbridge/gomatrix/events.go52
1 files changed, 47 insertions, 5 deletions
diff --git a/vendor/github.com/matterbridge/gomatrix/events.go b/vendor/github.com/matterbridge/gomatrix/events.go
index d065cd72..d3ee7491 100644
--- a/vendor/github.com/matterbridge/gomatrix/events.go
+++ b/vendor/github.com/matterbridge/gomatrix/events.go
@@ -15,6 +15,7 @@ type Event struct {
RoomID string `json:"room_id"` // The room the event was sent to. May be nil (e.g. for presence)
Content map[string]interface{} `json:"content"` // The JSON content of the event.
Redacts string `json:"redacts,omitempty"` // The event ID that was redacted if a m.room.redaction event
+ Unsigned map[string]interface{} `json:"unsigned"` // The unsigned portions of the event, such as age and prev_content
}
// Body returns the value of the "body" key in the event content if it is
@@ -47,22 +48,47 @@ type TextMessage struct {
FormattedBody string `json:"formatted_body,omitempty"`
}
-// ImageInfo contains info about an image - http://matrix.org/docs/spec/client_server/r0.2.0.html#m-image
-type ImageInfo struct {
+// ThumbnailInfo contains info about an thumbnail image - http://matrix.org/docs/spec/client_server/r0.2.0.html#m-image
+type ThumbnailInfo struct {
Height uint `json:"h,omitempty"`
Width uint `json:"w,omitempty"`
Mimetype string `json:"mimetype,omitempty"`
Size uint `json:"size,omitempty"`
}
+// ImageInfo contains info about an image - http://matrix.org/docs/spec/client_server/r0.2.0.html#m-image
+type ImageInfo struct {
+ Height uint `json:"h,omitempty"`
+ Width uint `json:"w,omitempty"`
+ Mimetype string `json:"mimetype,omitempty"`
+ Size uint `json:"size,omitempty"`
+ ThumbnailInfo ThumbnailInfo `json:"thumbnail_info,omitempty"`
+ ThumbnailURL string `json:"thumbnail_url,omitempty"`
+}
+
// VideoInfo contains info about a video - http://matrix.org/docs/spec/client_server/r0.2.0.html#m-video
type VideoInfo struct {
+ Mimetype string `json:"mimetype,omitempty"`
+ ThumbnailInfo ThumbnailInfo `json:"thumbnail_info"`
+ ThumbnailURL string `json:"thumbnail_url,omitempty"`
+ Height uint `json:"h,omitempty"`
+ Width uint `json:"w,omitempty"`
+ Duration uint `json:"duration,omitempty"`
+ Size uint `json:"size,omitempty"`
+}
+
+// AudioInfo contains info about a file - http://matrix.org/docs/spec/client_server/r0.2.0.html#m-audio
+type AudioInfo struct {
+ Mimetype string `json:"mimetype,omitempty"`
+ Size uint `json:"size,omitempty"`
+ Duration uint `json:"duration,omitempty"`
+}
+
+// FileInfo contains info about a file - http://matrix.org/docs/spec/client_server/r0.2.0.html#m-file
+type FileInfo struct {
Mimetype string `json:"mimetype,omitempty"`
ThumbnailInfo ImageInfo `json:"thumbnail_info"`
ThumbnailURL string `json:"thumbnail_url,omitempty"`
- Height uint `json:"h,omitempty"`
- Width uint `json:"w,omitempty"`
- Duration uint `json:"duration,omitempty"`
Size uint `json:"size,omitempty"`
}
@@ -82,6 +108,22 @@ type ImageMessage struct {
Info ImageInfo `json:"info"`
}
+// AudioMessage is an m.audio event
+type AudioMessage struct {
+ MsgType string `json:"msgtype"`
+ Body string `json:"body"`
+ URL string `json:"url"`
+ Info AudioInfo `json:"info"`
+}
+
+// FileMessage is a m.file event
+type FileMessage struct {
+ MsgType string `json:"msgtype"`
+ Body string `json:"body"`
+ URL string `json:"url"`
+ Info FileInfo `json:"info"`
+}
+
// An HTMLMessage is the contents of a Matrix HTML formated message event.
type HTMLMessage struct {
Body string `json:"body"`