Skip to content

Commit

Permalink
Merge branch 'master' into scrollback-posts-threads
Browse files Browse the repository at this point in the history
  • Loading branch information
hloeung authored Sep 10, 2023
2 parents 7eb2917 + 8adbbd3 commit 4f7c0e2
Show file tree
Hide file tree
Showing 480 changed files with 2,938 additions and 63,315 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.51.2
version: v1.53.3
args: "-v --new-from-rev HEAD~5"
test-build-upload:
strategy:
Expand All @@ -21,7 +21,7 @@ jobs:
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2
with:
platforms: amd64,arm64,arm
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2
-
name: Docker meta
id: meta
uses: docker/metadata-action@v3
uses: docker/metadata-action@v4
with:
images: 42wim/matterircd,ghcr.io/42wim/matterircd
flavor: |
Expand All @@ -42,14 +42,14 @@ jobs:
type=semver,pattern={{major}}.{{minor}}
-
name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v2
if: github.event_name != 'pull_request'
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Log into registry ghcr.io
uses: docker/login-action@v1
uses: docker/login-action@v2
if: github.event_name != 'pull_request'
with:
registry: ghcr.io
Expand All @@ -58,7 +58,7 @@ jobs:
-
name: Build and push
id: docker_build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6
Expand Down
8 changes: 8 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,14 @@ linters:
- execinquery
- nosnakecase
- exhaustive
- depguard
- deadcode
- structcheck
- varcheck
- ifshort
- gosmopolitan
- zerologlint
- tagalign

# rules to deal with reported isues
issues:
Expand Down
3 changes: 0 additions & 3 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ archives:
format: binary
files:
- none*
replacements:
386: 32bit
amd64: 64bit

checksum:
name_template: 'checksums.txt'
7 changes: 5 additions & 2 deletions bridge/mattermost/mattermost.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ func New(v *viper.Viper, cred bridge.Credentials, eventChan chan *bridge.Event,
// Create a unique matterircd instance tag so we don't relay messages sent from it.
charset := []byte("abcdefghijklmnopqrstuvwxyz")
b := make([]byte, 8)
rand.Seed(time.Now().UnixNano())
r := rand.New(rand.NewSource(time.Now().UnixNano())) //nolint:gosec
for i := range b {
b[i] = charset[rand.Intn(len(charset))] //nolint:gosec
b[i] = charset[r.Intn(len(charset))]
}
m.instanceTag = string(b)

Expand Down Expand Up @@ -956,6 +956,9 @@ func (m *Mattermost) handleWsActionPost(rmsg *model.WebSocketEvent) {
channelType = "D"
}
dmchannel = name

// We need to remove it from the cache so that replies use the latest msg.
m.msgParentCache.Remove(data.Id)
}

for _, msg := range msgs {
Expand Down
17 changes: 17 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# v0.27.1

## Enhancement

- general: Allow multiple instances of matterircd (#523)
- mattermost: Support mattermost version 8, drop support for version 6 (#539)
- mattermost: Improve on logging and make consistent with matterclient (#510)
- mattermost: Add caching of last sent msgs and 'lastsent' service command to show them (#520)
- mattermost: Update reactions so they're part of threads (#530)

## Bugfix

- mattermost: Add extra logging and fix return of wrong error (#529)

This release couldn't exist without the following contributors:
@hloeung

# v0.27.0

## New features
Expand Down
36 changes: 14 additions & 22 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
module github.com/42wim/matterircd

require (
github.com/alecthomas/chroma/v2 v2.4.0
github.com/alecthomas/chroma/v2 v2.8.0
github.com/davecgh/go-spew v1.1.1
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f
github.com/google/gops v0.3.27
github.com/grokify/html-strip-tags-go v0.0.1
github.com/hashicorp/golang-lru v0.6.0
github.com/matterbridge/logrus-prefixed-formatter v0.5.3-0.20200523233437-d971309a77ba
github.com/matterbridge/matterclient v0.0.0-20230329213635-bc6e42a4a84a
github.com/mattermost/mattermost-server/v5 v5.39.3
github.com/mattermost/mattermost-server/v6 v6.7.2
github.com/mattn/go-mastodon v0.0.6
github.com/mitchellh/mapstructure v1.5.0
github.com/muesli/reflow v0.3.0
github.com/sirupsen/logrus v1.9.0
github.com/slack-go/slack v0.12.1
github.com/sirupsen/logrus v1.9.3
github.com/slack-go/slack v0.12.2
github.com/sorcix/irc v1.1.4
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.15.0
github.com/stretchr/testify v1.8.2
github.com/spf13/viper v1.16.0
github.com/stretchr/testify v1.8.4
go.etcd.io/bbolt v1.3.7
)

Expand All @@ -34,8 +33,6 @@ require (
github.com/google/uuid v1.3.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/graph-gophers/graphql-go v1.3.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/jpillora/backoff v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
Expand All @@ -44,7 +41,6 @@ require (
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattermost/go-i18n v1.11.1-0.20211013152124-5c415071e404 // indirect
github.com/mattermost/ldap v0.0.0-20201202150706-ee0e6284187d // indirect
github.com/mattermost/logr v1.0.13 // indirect
github.com/mattermost/logr/v2 v2.0.15 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
Expand All @@ -59,35 +55,31 @@ require (
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/pborman/uuid v1.2.1 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.6 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/philhofer/fwd v1.1.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/rs/xid v1.4.0 // indirect
github.com/spf13/afero v1.9.3 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/afero v1.9.5 // indirect
github.com/spf13/cast v1.5.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
github.com/tinylib/msgp v1.1.6 // indirect
github.com/tomnomnom/linkheader v0.0.0-20180905144013-02ca5825eb80 // indirect
github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/wiggin77/cfg v1.0.2 // indirect
github.com/wiggin77/merror v1.0.3 // indirect
github.com/wiggin77/srslog v1.0.1 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
go.uber.org/zap v1.21.0 // indirect
golang.org/x/crypto v0.7.0 // indirect
golang.org/x/net v0.8.0 // indirect
golang.org/x/sys v0.6.0 // indirect
golang.org/x/term v0.6.0 // indirect
golang.org/x/text v0.8.0 // indirect
golang.org/x/crypto v0.9.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/term v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

go 1.17
go 1.19
Loading

0 comments on commit 4f7c0e2

Please sign in to comment.