aboutsummaryrefslogtreecommitdiff
path: root/connector/connector.go
diff options
context:
space:
mode:
Diffstat (limited to 'connector/connector.go')
-rw-r--r--connector/connector.go32
1 files changed, 18 insertions, 14 deletions
diff --git a/connector/connector.go b/connector/connector.go
index e8c382d..210d4ad 100644
--- a/connector/connector.go
+++ b/connector/connector.go
@@ -109,48 +109,48 @@ const (
)
type Event struct {
- Type EventType
+ Type EventType `json:"type"`
// If non-empty, the event Id is used to deduplicate events in a channel
// This is usefull for backends that provide a backlog of channel messages
// when (re-)joining a room
- Id string
+ Id string `json:"id"`
// UserID of the user that sent the event
// If this is a direct message event, this event can only have been authored
// by the user we are talking to (and not by ourself)
- Author UserID
+ Author UserID `json:"author"`
// UserID of the targetted user in the case of a direct message,
// empty if targetting a room
- Recipient UserID
+ Recipient UserID `json:"recipient"`
// RoomID of the room where the event happenned or of the targetted room,
// or empty string if it happenned by direct message
- Room RoomID
+ Room RoomID `json:"room"`
// Message text or action text
- Text string
+ Text string `json:"text`
// Attached files such as images
- Attachments []MediaObject
+ Attachments []SMediaObject `json:"attachments"`
}
type UserInfo struct {
- DisplayName string
+ DisplayName string `json:"display_name"`
// If non-empty, the Filename of the avatar object will be used by Easybridge
// to deduplicate the update events and prevent needless reuploads.
// Example strategy that works for the mattermost backend: use the update timestamp as fictious file name
- Avatar MediaObject
+ Avatar SMediaObject `json:"avatar"`
}
type RoomInfo struct {
- Name string
- Topic string
+ Name string `json:"name"`
+ Topic string `json:"topic"`
// Same deduplication comment as for UserInfo.Avatar
- Picture MediaObject
+ Picture SMediaObject `json:"picture"`
}
type MediaObject interface {
@@ -169,7 +169,11 @@ type MediaObject interface {
URL() string
}
+type SMediaObject struct {
+ MediaObject
+}
+
type ImageSize struct {
- Width int
- Height int
+ Width int `json:"width"`
+ Height int `json:"height"`
}