42wim / matterbridge

bridge between mattermost, IRC, gitter, xmpp, slack, discord, telegram, rocketchat, twitch, ssh-chat, zulip, whatsapp, keybase, matrix, microsoft teams, nextcloud, mumble, vk and more with REST API (mattermost not required!)
Apache License 2.0
6.66k stars 618 forks source link

[rocketchat] matterbridge thinks that messages with attachments are empty #774

Open iprok opened 5 years ago

iprok commented 5 years ago

Describe the bug We have telegram <-> rocketchat inout gateway. For rocketchat just switched to new API version of gateway. Have problem with attachments from rocketchat. Matterbridge just doesn't see them. See logs. MediaServer is set up.

To Reproduce Use matterbridge 1.14.1 and rocketchat 0.74.3. Make bridge rocketchat->telegram. Try to send attachment in rocketchat.

Expected behavior Attachments go successfully telegram<->rocketchat

Screenshots/debug logs Matterbridge log: [0000] INFO main: Gateway(s) started succesfully. Now relaying messages [0028] DEBUG rocketchat: message models.Message{ID:"w7B", RoomID:"ELR", Msg:"", EditedBy:"", Groupable:false, EditedAt:(time.Time)(nil), Timestamp:(time.Time)(0xc00057e0c0), UpdatedAt:(time.Time)(nil), Mentions:[]models.User(nil), User:(models.User)(0xc000469980), PostMessage:models.PostMessage{RoomID:"", Channel:"", Text:"", ParseUrls:false, Alias:"", Emoji:"", Avatar:"", Attachments:[]models.Attachment(nil)}} [0028] DEBUG rocketchat: <= Sending message from i on rocketchat.t to gateway [0028] DEBUG rocketchat: <= Message is &config.Message{Text:"", Channel:"test", Username:"i", UserID:"3o6", Avatar:"", Account:"rocketchat.t", Event:"", Protocol:"", Gateway:"", ParentID:"", Timestamp:time.Time{wall:0x0, ext:0, loc:(time.Location)(nil)}, ID:"w7B", Extra:map[string][]interface {}(nil)} [0028] DEBUG gateway: ignoring empty message &config.Message{Text:"", Channel:"test", Username:"i", UserID:"3o6", Avatar:"", Account:"rocketchat.t", Event:"", Protocol:"", Gateway:"", ParentID:"", Timestamp:time.Time{wall:0x0, ext:0, loc:(time.Location)(nil)}, ID:"w7B", Extra:map[string][]interface {}(nil)} from rocketchat.t [0028] DEBUG gateway: ignoring empty message &config.Message{Text:"", Channel:"test", Username:"i", UserID:"3o6", Avatar:"", Account:"rocketchat.t", Event:"", Protocol:"", Gateway:"", ParentID:"", Timestamp:time.Time{wall:0x0, ext:0, loc:(time.Location)(nil)}, ID:"w7B", Extra:map[string][]interface {}(nil)} from rocketchat.t [0028] DEBUG gateway: ignoring empty message &config.Message{Text:"", Channel:"test", Username:"i", UserID:"3o6", Avatar:"", Account:"rocketchat.t", Event:"", Protocol:"", Gateway:"", ParentID:"", Timestamp:time.Time{wall:0x0, ext:0, loc:(time.Location)(nil)}, ID:"w7B", Extra:map[string][]interface {}(nil)} from rocketchat.t [0028] DEBUG gateway: ignoring empty message &config.Message{Text:"", Channel:"test", Username:"i", UserID:"3o6", Avatar:"", Account:"rocketchat.t", Event:"", Protocol:"", Gateway:"", ParentID:"", Timestamp:time.Time{wall:0x0, ext:0, loc:(time.Location)(nil)}, ID:"w7B", Extra:map[string][]interface {}(nil)} from rocketchat.t [0028] DEBUG gateway: ignoring empty message &config.Message{Text:"", Channel:"test", Username:"i", UserID:"3o6", Avatar:"", Account:"rocketchat.t", Event:"", Protocol:"", Gateway:"", ParentID:"", Timestamp:time.Time{wall:0x0, ext:0, loc:(time.Location)(nil)}, ID:"w7B", Extra:map[string][]interface {}(nil)} from rocketchat.t [0028] DEBUG gateway: ignoring empty message &config.Message{Text:"", Channel:"test", Username:"i", UserID:"3o6", Avatar:"", Account:"rocketchat.t", Event:"", Protocol:"", Gateway:"", ParentID:"", Timestamp:time.Time{wall:0x0, ext:0, loc:(time.Location)(nil)}, ID:"w7B", Extra:map[string][]interface {}(nil)} from rocketchat.t [0028] DEBUG gateway: ignoring empty message &config.Message{Text:"", Channel:"test", Username:"i", UserID:"3o6", Avatar:"", Account:"rocketchat.t", Event:"", Protocol:"", Gateway:"", ParentID:"", Timestamp:time.Time{wall:0x0, ext:0, loc:(time.Location)(nil)}, ID:"w7B", Extra:map[string][]interface {}(nil)} from rocketchat.t [0028] DEBUG gateway: ignoring empty message &config.Message{Text:"", Channel:"test", Username:"i", UserID:"3o6", Avatar:"", Account:"rocketchat.t", Event:"", Protocol:"", Gateway:"", ParentID:"", Timestamp:time.Time{wall:0x0, ext:0, loc:(time.Location)(nil)}, ID:"w7B", Extra:map[string][]interface {}(nil)} from rocketchat.t [0028] DEBUG gateway: ignoring empty message &config.Message{Text:"", Channel:"test", Username:"i", UserID:"3o6", Avatar:"", Account:"rocketchat.t", Event:"", Protocol:"", Gateway:"", ParentID:"", Timestamp:time.Time{wall:0x0, ext:0, loc:(time.Location)(nil)}, ID:"w7B", Extra:map[string][]interface {}(nil)} from rocketchat.t

Environment (please complete the following information):

OS: Linux amd64
Matterbridge version: 1.14.1
42wim commented 5 years ago

Yes, the rocketchat library we use doesn't support that, see https://github.com/RocketChat/Rocket.Chat.Go.SDK/issues/22

@drndos was/is working on this though in #756 (are you still working on this @drndos?)

drndos commented 5 years ago

Hello, yes sorry for the delay, after I got it working I have been working on other stuff on my TODO list :) I will try to make it acceptable this week I hope.

42wim commented 5 years ago

@drndos no worries, there's no rush. Just checking that you're still interested :)

42wim commented 5 years ago

@drndos just checking in :-)