commit 54f900d4055947e4821c62d6f403391d6c72121e
Author: selfhoster1312 <selfhoster1312@kl.netlib.re>
Date: Fri Oct 24 17:29:16 2025 +0000
diff --git a/bridge/config/config.go b/bridge/config/config.go
index 0cccdab..31b48ce 100644
--- a/bridge/config/config.go
+++ b/bridge/config/config.go
@@ -887 +886 @@ type ChannelMembers []ChannelMember
type Protocol struct {
AllowMention []string // discord
- AuthCode string // steam
BindAddress string // mattermost, slack // DEPRECATED
Buffer int // api
Charset string // irc
diff --git a/bridge/steam/handlers.go b/bridge/steam/handlers.go
deleted file mode 100644
index fa5015c..0000000
--- a/bridge/steam/handlers.go
+++ /dev/null
@@ -1126 +00 @@
-package bsteam
-
-import (
- "fmt"
- "strconv"
-
- "github.com/42wim/matterbridge/bridge/config"
- "github.com/Philipp15b/go-steam"
- "github.com/Philipp15b/go-steam/protocol/steamlang"
-)
-
-func (b *Bsteam) handleChatMsg(e *steam.ChatMsgEvent) {
- b.Log.Debugf("Receiving ChatMsgEvent: %#v", e)
- b.Log.Debugf("<= Sending message from %s on %s to gateway", b.getNick(e.ChatterId), b.Account)
- var channel int64
- if e.ChatRoomId == 0 {
- channel = int64(e.ChatterId)
- } else {
- // for some reason we have to remove 0x18000000000000
- // TODO
- // https://github.com/42wim/matterbridge/pull/630#discussion_r238102751
- // channel = int64(e.ChatRoomId) & 0xfffffffffffff
- channel = int64(e.ChatRoomId) - 0x18000000000000
- }
- msg := config.Message{
- Username: b.getNick(e.ChatterId),
- Text: e.Message,
- Channel: strconv.FormatInt(channel, 10),
- Account: b.Account,
- UserID: strconv.FormatInt(int64(e.ChatterId), 10),
- }
- b.Remote <- msg
-}
-
-func (b *Bsteam) handleEvents() {
- myLoginInfo := &steam.LogOnDetails{
- Username: b.GetString("Login"),
- Password: b.GetString("Password"),
- AuthCode: b.GetString("AuthCode"),
- }
- // TODO Attempt to read existing auth hash to avoid steam guard.
- // Maybe works
- //myLoginInfo.SentryFileHash, _ = ioutil.ReadFile("sentry")
- for event := range b.c.Events() {
- switch e := event.(type) {
- case *steam.ChatMsgEvent:
- b.handleChatMsg(e)
- case *steam.PersonaStateEvent:
- b.Log.Debugf("PersonaStateEvent: %#v\n", e)
- b.Lock()
- b.userMap[e.FriendId] = e.Name
- b.Unlock()
- case *steam.ConnectedEvent:
- b.c.Auth.LogOn(myLoginInfo)
- case *steam.MachineAuthUpdateEvent:
- // TODO sentry files for 2 auth
- /*
- b.Log.Info("authupdate", e)
- b.Log.Info("hash", e.Hash)
- ioutil.WriteFile("sentry", e.Hash, 0666)
- */
- case *steam.LogOnFailedEvent:
- b.Log.Info("Logon failed", e)
- err := b.handleLogOnFailed(e, myLoginInfo)
- if err != nil {
- b.Log.Error(err)
- return
- }
- case *steam.LoggedOnEvent:
- b.Log.Debugf("LoggedOnEvent: %#v", e)
- b.connected <- struct{}{}
- b.Log.Debugf("setting online")
- b.c.Social.SetPersonaState(steamlang.EPersonaState_Online)
- case *steam.DisconnectedEvent:
- b.Log.Info("Disconnected")
- b.Log.Info("Attempting to reconnect...")
- b.c.Connect()
- case steam.FatalErrorEvent:
- b.Log.Errorf("steam FatalErrorEvent: %#v", e)
- default:
- b.Log.Debugf("unknown event %#v", e)
- }
- }
-}
-
-func (b *Bsteam) handleLogOnFailed(e *steam.LogOnFailedEvent, myLoginInfo *steam.LogOnDetails) error {
- switch e.Result {
- case steamlang.EResult_AccountLoginDeniedNeedTwoFactor:
- b.Log.Info("Steam guard isn't letting me in! Enter 2FA code:")
- var code string
- fmt.Scanf("%s", &code)
- // TODO https://github.com/42wim/matterbridge/pull/630#discussion_r238103978
- myLoginInfo.TwoFactorCode = code
- case steamlang.EResult_AccountLogonDenied:
- b.Log.Info("Steam guard isn't letting me in! Enter auth code:")
- var code string
- fmt.Scanf("%s", &code)
- // TODO https://github.com/42wim/matterbridge/pull/630#discussion_r238103978
- myLoginInfo.AuthCode = code
- case steamlang.EResult_InvalidLoginAuthCode:
- return fmt.Errorf("Steam guard: invalid login auth code: %#v ", e.Result)
- default:
- return fmt.Errorf("LogOnFailedEvent: %#v ", e.Result)
- // TODO: Handle EResult_InvalidLoginAuthCode
- }
- return nil
-}
-
-// handleFileInfo handles config.FileInfo and adds correct file comment or URL to msg.Text.
-// Returns error if cast fails.
-func (b *Bsteam) handleFileInfo(msg *config.Message, f interface{}) error {
- if _, ok := f.(config.FileInfo); !ok {
- return fmt.Errorf("handleFileInfo cast failed %#v", f)
- }
- fi := f.(config.FileInfo)
- if fi.Comment != "" {
- msg.Text += fi.Comment + ": "
- }
- if fi.URL != "" {
- msg.Text = fi.URL
- if fi.Comment != "" {
- msg.Text = fi.Comment + ": " + fi.URL
- }
- }
- return nil
-}
diff --git a/bridge/steam/steam.go b/bridge/steam/steam.go
deleted file mode 100644
index 5a577a2..0000000
--- a/bridge/steam/steam.go
+++ /dev/null
@@ -195 +00 @@
-package bsteam
-
-import (
- "fmt"
- "sync"
- "time"
-
- "github.com/42wim/matterbridge/bridge"
- "github.com/42wim/matterbridge/bridge/config"
- "github.com/42wim/matterbridge/bridge/helper"
- "github.com/Philipp15b/go-steam"
- "github.com/Philipp15b/go-steam/protocol/steamlang"
- "github.com/Philipp15b/go-steam/steamid"
-)
-
-type Bsteam struct {
- c *steam.Client
- connected chan struct{}
- userMap map[steamid.SteamId]string
- sync.RWMutex
- *bridge.Config
-}
-
-func New(cfg *bridge.Config) bridge.Bridger {
- b := &Bsteam{Config: cfg}
- b.userMap = make(map[steamid.SteamId]string)
- b.connected = make(chan struct{})
- return b
-}
-
-func (b *Bsteam) Connect() error {
- b.Log.Info("Connecting")
- b.c = steam.NewClient()
- go b.handleEvents()
- go b.c.Connect()
- select {
- case <-b.connected:
- b.Log.Info("Connection succeeded")
- case <-time.After(time.Second * 30):
- return fmt.Errorf("connection timed out")
- }
- return nil
-}
-
-func (b *Bsteam) Disconnect() error {
- b.c.Disconnect()
- return nil
-
-}
-
-func (b *Bsteam) JoinChannel(channel config.ChannelInfo) error {
- id, err := steamid.NewId(channel.Name)
- if err != nil {
- return err
- }
- b.c.Social.JoinChat(id)
- return nil
-}
-
-func (b *Bsteam) Send(msg config.Message) (string, error) {
- // ignore delete messages
- if msg.Event == config.EventMsgDelete {
- return "", nil
- }
- id, err := steamid.NewId(msg.Channel)
- if err != nil {
- return "", err
- }
-
- // Handle files
- if msg.Extra != nil {
- for _, rmsg := range helper.HandleExtra(&msg, b.General) {
- b.c.Social.SendMessage(id, steamlang.EChatEntryType_ChatMsg, rmsg.Username+rmsg.Text)
- }
- for i := range msg.Extra["file"] {
- if err := b.handleFileInfo(&msg, msg.Extra["file"][i]); err != nil {
- b.Log.Error(err)
- }
- b.c.Social.SendMessage(id, steamlang.EChatEntryType_ChatMsg, msg.Username+msg.Text)
- }
- return "", nil
- }
-
- b.c.Social.SendMessage(id, steamlang.EChatEntryType_ChatMsg, msg.Username+msg.Text)
- return "", nil
-}
-
-func (b *Bsteam) getNick(id steamid.SteamId) string {
- b.RLock()
- defer b.RUnlock()
- if name, ok := b.userMap[id]; ok {
- return name
- }
- return "unknown"
-}
diff --git a/changelog.md b/changelog.md
index 4f54867..141ed2e 100644
--- a/changelog.md
+++ b/changelog.md
@@ -86 +87 @@
- Removed protocols, see [issue community/#9](https://github.com/matterbridge-org/matterbridge/issues/9)
- harmony protocol does not exist anymore
- gitter protocol does not exist anymore ; gitter.im is now a matrix protocol server
+ - steam protocol has changed profoundly
# v1.26.0
diff --git a/docs/credits.md b/docs/credits.md
index 6d27e7e..3f72898 100644
--- a/docs/credits.md
+++ b/docs/credits.md
@@ -197 +196 @@ Matterbridge wouldn't exist without these libraries:
- rocketchat - <https://github.com/RocketChat/Rocket.Chat.Go.SDK>
- slack - <https://github.com/nlopes/slack>
- sshchat - <https://github.com/shazow/ssh-chat>
-- steam - <https://github.com/Philipp15b/go-steam>
- telegram - <https://github.com/go-telegram-bot-api/telegram-bot-api>
- tengo - <https://github.com/d5/tengo>
- vk - <https://github.com/SevereCloud/vksdk>
diff --git a/gateway/bridgemap/bsteam.go b/gateway/bridgemap/bsteam.go
deleted file mode 100644
index 706e626..0000000
--- a/gateway/bridgemap/bsteam.go
+++ /dev/null
@@ -112 +00 @@
-//go:build !nosteam
-// +build !nosteam
-
-package bridgemap
-
-import (
- bsteam "github.com/42wim/matterbridge/bridge/steam"
-)
-
-func init() {
- FullMap["steam"] = bsteam.New
-}
diff --git a/go.mod b/go.mod
index fc87aed..ea38049 100644
--- a/go.mod
+++ b/go.mod
@@ -37 +36 @@ module github.com/42wim/matterbridge
require (
github.com/Baozisoftware/qrcode-terminal-go v0.0.0-20170407111555-c0650d8dff0f
github.com/Benau/tgsconverter v0.0.0-20210809170556-99f4a4f6337f
- github.com/Philipp15b/go-steam v1.0.1-0.20200727090957-6ae9b3c0a560
github.com/Rhymen/go-whatsapp v0.1.2-0.20211102134409-31a2e740845c
github.com/SevereCloud/vksdk/v2 v2.17.0
github.com/bwmarrin/discordgo v0.28.1
diff --git a/go.sum b/go.sum
index 161cdfc..ddb8030 100644
--- a/go.sum
+++ b/go.sum
@@ -188 +186 @@ github.com/Benau/tgsconverter v0.0.0-20210809170556-99f4a4f6337f/go.mod h1:AQiQK
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/Jeffail/gabs v1.4.0 h1://5fYRRTq1edjfIrQGvdkcd22pkYUrHZ5YC/H2GJVAo=
github.com/Jeffail/gabs v1.4.0/go.mod h1:6xMvQMK4k33lb7GUUpaAPh6nKMmemQeg5d4gn7/bOXc=
-github.com/Philipp15b/go-steam v1.0.1-0.20200727090957-6ae9b3c0a560 h1:ItnC9PEEMESzTbFayxrhKBbuFQOXDBI8yy7NudTcEWs=
-github.com/Philipp15b/go-steam v1.0.1-0.20200727090957-6ae9b3c0a560/go.mod h1:o38AwUFFS4gzbjSoyIgrZ1h9UeDrKwcci1Pj6baifvI=
github.com/Rhymen/go-whatsapp v0.1.2-0.20211102134409-31a2e740845c h1:4mIZQXKYBymQ9coA82nNyG/CjicMNLBZ8cPVrhNUM3g=
github.com/Rhymen/go-whatsapp v0.1.2-0.20211102134409-31a2e740845c/go.mod h1:DNSFRLFDFIqm2+0aJzSOVfn25020vldM4SRqz6YtLgI=
github.com/SevereCloud/vksdk/v2 v2.17.0 h1:Wll63JSuBTdE0L7+V/PMn9PyhLrWSWIjX76XpWbXTFw=
@@ -1007 +986 @@ github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrU
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
-github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/gomarkdown/markdown v0.0.0-20240419095408-642f0ee99ae2 h1:yEt5djSYb4iNtmV9iJGVday+i4e9u6Mrn5iP64HH5QM=
@@ -5787 +5756 @@ google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQ
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
-google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
diff --git a/matterbridge.toml.sample b/matterbridge.toml.sample
index f1d4ba2..1ad39e2 100644
--- a/matterbridge.toml.sample
+++ b/matterbridge.toml.sample
@@ -133198 +13316 @@ StripNick=false
#OPTIONAL (default false)
ShowTopicChange=false
-###################################################################
-#steam section
-###################################################################
-[steam]
-#You can configure multiple servers "[steam.name]" or "[steam.name2]"
-#In this example we use [steam.gamechat]
-#REQUIRED
-
-[steam.gamechat]
-#login/pass of your bot.
-#Use a dedicated user for this and not your own account!
-#REQUIRED
-Login="yourlogin"
-Password="yourpass"
-
-#steamguard mail authcode (not the 2FA code)
-#OPTIONAL
-Authcode="ABCE12"
-
-## RELOADABLE SETTINGS
-## Settings below can be reloaded by editing the file
-
-#Whether to prefix messages from other bridges to matrix with the sender's nick.
-#Useful if username overrides for incoming webhooks isn't enabled on the
-#matrix server. If you set PrefixMessagesWithNick to true, each message
-#from bridge to matrix will by default be prefixed by the RemoteNickFormat setting. i
-#OPTIONAL (default false)
-PrefixMessagesWithNick=false
-
-#Nicks you want to ignore.
-#Regular expressions supported
-#Messages from those users will not be sent to other bridges.
-#OPTIONAL
-IgnoreNicks="spammer1 spammer2"
-
-#Messages you want to ignore.
-#Messages matching these regexp will be ignored and not sent to other bridges
-#See https://regex-golang.appspot.com/assets/html/index.html for more regex info
-#OPTIONAL (example below ignores messages starting with ~~ or messages containing badword
-IgnoreMessages="^~~ badword"
-
-#messages you want to replace.
-#it replaces outgoing messages from the bridge.
-#so you need to place it by the sending bridge definition.
-#regular expressions supported
-#some examples:
-#this replaces cat => dog and sleep => awake
-#replacemessages=[ ["cat","dog"], ["sleep","awake"] ]
-#this replaces every number with number. 123 => numbernumbernumber
-#replacemessages=[ ["[0-9]","number"] ]
-#optional (default empty)
-ReplaceMessages=[ ["cat","dog"] ]
-
-#nicks you want to replace.
-#see replacemessages for syntax
-#optional (default empty)
-ReplaceNicks=[ ["user--","user"] ]
-
-#Extractnicks is used to for example rewrite messages from other relaybots
-#See https://github.com/42wim/matterbridge/issues/713 and https://github.com/42wim/matterbridge/issues/466
-#some examples:
-#this replaces a message like "Relaybot: <relayeduser> something interesting" to "relayeduser: something interesting"
-#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ] ]
-#you can use multiple entries for multiplebots
-#this also replaces a message like "otherbot: (relayeduser) something else" to "relayeduser: something else"
-#ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ],[ "otherbot","\\((.*?)\\)\\s+" ]
-#OPTIONAL (default empty)
-ExtractNicks=[ ["otherbot","<(.*?)>\\s+" ] ]
-
-#extra label that can be used in the RemoteNickFormat
-#optional (default empty)
-Label=""
-
-#RemoteNickFormat defines how remote users appear on this bridge
-#See [general] config section for default options
-RemoteNickFormat="[{PROTOCOL}] <{NICK}> "
-
-#Enable to show users joins/parts from other bridges
-#Currently works for messages from the following bridges: irc, mattermost, mumble, slack, discord
-#OPTIONAL (default false)
-ShowJoinPart=false
-
-#StripNick only allows alphanumerical nicks. See https://github.com/42wim/matterbridge/issues/285
-#It will strip other characters from the nick
-#OPTIONAL (default false)
-StripNick=false
-
-#Enable to show topic changes from other bridges
-#Only works hiding/show topic changes from slack bridge for now
-#OPTIONAL (default false)
-ShowTopicChange=false
-
###################################################################
# NCTalk (Nextcloud Talk)
###################################################################
@@ -18628 +17706 @@ enable=true
- # steam | chatid | example needed | The number in the URL when you click "enter chat room" in the browser
- # -------------------------------------------------------------------------------------------------------------------------------------