diff options
Diffstat (limited to 'gateway')
-rw-r--r-- | gateway/gateway.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gateway/gateway.go b/gateway/gateway.go index be09ac76..03d6aa92 100644 --- a/gateway/gateway.go +++ b/gateway/gateway.go @@ -5,6 +5,7 @@ import ( "github.com/42wim/matterbridge/bridge" "github.com/42wim/matterbridge/bridge/config" log "github.com/Sirupsen/logrus" + "github.com/peterhellberg/emojilib" // "github.com/davecgh/go-spew/spew" "regexp" "strings" @@ -116,6 +117,7 @@ func (gw *Gateway) handleReceive() { } if !gw.ignoreMessage(&msg) { msg.Timestamp = time.Now() + gw.modifyMessage(&msg) for _, br := range gw.Bridges { gw.handleMessage(msg, br) } @@ -296,6 +298,11 @@ func (gw *Gateway) modifyAvatar(msg *config.Message, dest *bridge.Bridge) { } } +func (gw *Gateway) modifyMessage(msg *config.Message) { + // replace :emoji: to unicode + msg.Text = emojilib.Replace(msg.Text) +} + func getChannelID(msg config.Message) string { return msg.Channel + msg.Account } |