mirror of
https://github.com/cwinfo/matterbridge.git
synced 2024-11-22 09:20:27 +00:00
Update matterbridge/Rocket.Chat.Go.SDK (#1087)
This commit is contained in:
parent
976fbcd07f
commit
13c90893c7
2
go.mod
2
go.mod
@ -21,7 +21,7 @@ require (
|
||||
github.com/keybase/go-keybase-chat-bot v0.0.0-20200226211841-4e48f3eaef3e
|
||||
github.com/labstack/echo/v4 v4.1.13
|
||||
github.com/lrstanley/girc v0.0.0-20190801035559-4fc93959e1a7
|
||||
github.com/matterbridge/Rocket.Chat.Go.SDK v0.0.0-20190210153444-cc9d05784d5d
|
||||
github.com/matterbridge/Rocket.Chat.Go.SDK v0.0.0-20200411204219-d5c18ce75048
|
||||
github.com/matterbridge/discordgo v0.18.1-0.20200308151012-aa40f01cbcc3
|
||||
github.com/matterbridge/emoji v2.1.1-0.20191117213217-af507f6b02db+incompatible
|
||||
github.com/matterbridge/go-xmpp v0.0.0-20200329150250-5812999b292b
|
||||
|
4
go.sum
4
go.sum
@ -124,8 +124,8 @@ github.com/lrstanley/girc v0.0.0-20190801035559-4fc93959e1a7 h1:BS9tqL0OCiOGuy/C
|
||||
github.com/lrstanley/girc v0.0.0-20190801035559-4fc93959e1a7/go.mod h1:liX5MxHPrwgHaKowoLkYGwbXfYABh1jbZ6FpElbGF1I=
|
||||
github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4=
|
||||
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
|
||||
github.com/matterbridge/Rocket.Chat.Go.SDK v0.0.0-20190210153444-cc9d05784d5d h1:F+Sr+C0ojSlYQ37BLylQtSFmyQULe3jbAygcyXQ9mVs=
|
||||
github.com/matterbridge/Rocket.Chat.Go.SDK v0.0.0-20190210153444-cc9d05784d5d/go.mod h1:c6MxwqHD+0HvtAJjsHMIdPCiAwGiQwPRPTp69ACMg8A=
|
||||
github.com/matterbridge/Rocket.Chat.Go.SDK v0.0.0-20200411204219-d5c18ce75048 h1:B9HaistmV+MD8/33BXmZe1zPIn+RImAFVXNNSOrwU2E=
|
||||
github.com/matterbridge/Rocket.Chat.Go.SDK v0.0.0-20200411204219-d5c18ce75048/go.mod h1:c6MxwqHD+0HvtAJjsHMIdPCiAwGiQwPRPTp69ACMg8A=
|
||||
github.com/matterbridge/discordgo v0.18.1-0.20200308151012-aa40f01cbcc3 h1:VP/DNRn2HtrVRN6+X3h4FDcQI2OOKT+88WUi21ZD1Kw=
|
||||
github.com/matterbridge/discordgo v0.18.1-0.20200308151012-aa40f01cbcc3/go.mod h1:5a1bHtG/38ofcx9cgwM5eTW/Pl4SpbQksNDnTRcGA2Y=
|
||||
github.com/matterbridge/emoji v2.1.1-0.20191117213217-af507f6b02db+incompatible h1:oaOqwbg5HxHRxvAbd84ks0Okwoc1ISyUZ87EiVJFhGI=
|
||||
|
4
vendor/github.com/matterbridge/Rocket.Chat.Go.SDK/models/message.go
generated
vendored
4
vendor/github.com/matterbridge/Rocket.Chat.Go.SDK/models/message.go
generated
vendored
@ -7,6 +7,7 @@ type Message struct {
|
||||
RoomID string `json:"rid"`
|
||||
Msg string `json:"msg"`
|
||||
EditedBy string `json:"editedBy,omitempty"`
|
||||
Type string `json:"t,omitempty"`
|
||||
|
||||
Groupable bool `json:"groupable,omitempty"`
|
||||
|
||||
@ -16,6 +17,9 @@ type Message struct {
|
||||
|
||||
Mentions []User `json:"mentions,omitempty"`
|
||||
User *User `json:"u,omitempty"`
|
||||
|
||||
Attachments []Attachment `json:"attachments,omitempty"`
|
||||
|
||||
PostMessage
|
||||
|
||||
// Bot interface{} `json:"bot"`
|
||||
|
22
vendor/github.com/matterbridge/Rocket.Chat.Go.SDK/realtime/messages.go
generated
vendored
22
vendor/github.com/matterbridge/Rocket.Chat.Go.SDK/realtime/messages.go
generated
vendored
@ -191,6 +191,26 @@ func getMessageFromData(data interface{}) *models.Message {
|
||||
|
||||
func getMessageFromDocument(arg *gabs.Container) *models.Message {
|
||||
var ts *time.Time
|
||||
var attachments []models.Attachment
|
||||
|
||||
attachmentSrc, err := arg.Path("attachments").Children()
|
||||
if err != nil {
|
||||
attachments = make([]models.Attachment, 0)
|
||||
} else {
|
||||
attachments = make([]models.Attachment, len(attachmentSrc))
|
||||
for i, attachment := range attachmentSrc {
|
||||
attachments[i] = models.Attachment{
|
||||
Timestamp: stringOrZero(attachment.Path("ts").Data()),
|
||||
Title: stringOrZero(attachment.Path("title").Data()),
|
||||
TitleLink: stringOrZero(attachment.Path("title_link").Data()),
|
||||
TitleLinkDownload: stringOrZero(attachment.Path("title_link_download").Data()),
|
||||
ImageURL: stringOrZero(attachment.Path("image_url").Data()),
|
||||
|
||||
AuthorName: stringOrZero(arg.Path("u.name").Data()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
date := stringOrZero(arg.Path("ts.$date").Data())
|
||||
if len(date) > 0 {
|
||||
if ti, err := strconv.ParseFloat(date, 64); err == nil {
|
||||
@ -202,11 +222,13 @@ func getMessageFromDocument(arg *gabs.Container) *models.Message {
|
||||
ID: stringOrZero(arg.Path("_id").Data()),
|
||||
RoomID: stringOrZero(arg.Path("rid").Data()),
|
||||
Msg: stringOrZero(arg.Path("msg").Data()),
|
||||
Type: stringOrZero(arg.Path("t").Data()),
|
||||
Timestamp: ts,
|
||||
User: &models.User{
|
||||
ID: stringOrZero(arg.Path("u._id").Data()),
|
||||
UserName: stringOrZero(arg.Path("u.username").Data()),
|
||||
},
|
||||
Attachments: attachments,
|
||||
}
|
||||
}
|
||||
|
||||
|
2
vendor/modules.txt
vendored
2
vendor/modules.txt
vendored
@ -95,7 +95,7 @@ github.com/labstack/gommon/random
|
||||
github.com/lrstanley/girc
|
||||
# github.com/magiconair/properties v1.8.1
|
||||
github.com/magiconair/properties
|
||||
# github.com/matterbridge/Rocket.Chat.Go.SDK v0.0.0-20190210153444-cc9d05784d5d
|
||||
# github.com/matterbridge/Rocket.Chat.Go.SDK v0.0.0-20200411204219-d5c18ce75048
|
||||
github.com/matterbridge/Rocket.Chat.Go.SDK/models
|
||||
github.com/matterbridge/Rocket.Chat.Go.SDK/realtime
|
||||
github.com/matterbridge/Rocket.Chat.Go.SDK/rest
|
||||
|
Loading…
Reference in New Issue
Block a user