Skip to content

Commit

Permalink
zulip: Use the matterbridge version in the user-agent.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmv committed Sep 21, 2021
1 parent 9f971cd commit e190db7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
4 changes: 3 additions & 1 deletion bridge/zulip/zulip.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package bzulip

import (
"encoding/json"
"fmt"
"io/ioutil"
"strconv"
"strings"
Expand All @@ -11,6 +12,7 @@ import (
"github.com/42wim/matterbridge/bridge"
"github.com/42wim/matterbridge/bridge/config"
"github.com/42wim/matterbridge/bridge/helper"
"github.com/42wim/matterbridge/version"
gzb "github.com/matterbridge/gozulipbot"
)

Expand All @@ -27,7 +29,7 @@ func New(cfg *bridge.Config) bridge.Bridger {
}

func (b *Bzulip) Connect() error {
bot := gzb.Bot{APIKey: b.GetString("token"), APIURL: b.GetString("server") + "/api/v1/", Email: b.GetString("login")}
bot := gzb.Bot{APIKey: b.GetString("token"), APIURL: b.GetString("server") + "/api/v1/", Email: b.GetString("login"), UserAgent: fmt.Sprintf("matterbridge/%s", version.Release)}
bot.Init()
q, err := bot.RegisterAll()
b.q = q
Expand Down
20 changes: 12 additions & 8 deletions vendor/github.com/matterbridge/gozulipbot/bot.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e190db7

Please # to comment.