Skip to content

Commit

Permalink
Send notice message when logged out
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewFerr committed Nov 15, 2023
1 parent 1ffe5ea commit b8657cf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions user.go
Original file line number Diff line number Diff line change
Expand Up @@ -385,12 +385,16 @@ func (user *User) startupTryConnect(retryCount int) {

case signalmeow.SignalConnectionEventLoggedOut:
user.log.Debug().Msg("Sending BadCredentials BridgeState")
defaultMessage := "You have been logged out of Signal, please reconnect"
if err == nil {
user.BridgeState.Send(status.BridgeState{StateEvent: status.StateBadCredentials, Message: "You have been logged out of Signal, please reconnect"})
} else {
user.BridgeState.Send(status.BridgeState{StateEvent: status.StateBadCredentials, Message: err.Error()})
}
user.clearMySignalKeys()
if roomID := user.GetManagementRoomID(); roomID != "" {
user.bridge.Bot.SendNotice(roomID, defaultMessage)
}

case signalmeow.SignalConnectionEventError:
user.log.Debug().Msg("Sending UnknownError BridgeState")
Expand Down

0 comments on commit b8657cf

Please sign in to comment.