Skip to content
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.

Commit

Permalink
Send BAD_CREDENTIALS on signalgo migration
Browse files Browse the repository at this point in the history
Or really any time Signal device credentials should be in signalmeow DB
but aren't there.
  • Loading branch information
smweber committed Dec 14, 2023
1 parent 3953789 commit 63b24c8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 0 additions & 1 deletion pkg/signalmeow/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ func (d *Device) IsDeviceLoggedIn() bool {
d.Data.AciUuid != "" &&
d.Data.DeviceId != 0 &&
d.Data.Password != ""

}

func (d *Device) ClearKeysAndDisconnect() error {
Expand Down
5 changes: 3 additions & 2 deletions user.go
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,9 @@ func (br *SignalBridge) StartUsers() {
numUsersStarting := 0
for _, u := range usersWithToken {
device := u.populateSignalDevice()
if device == nil {
br.ZLog.Warn().Str("user_id", u.MXID.String()).Msg("No device found for user, skipping Connect")
if device == nil || !device.IsDeviceLoggedIn() {
br.ZLog.Warn().Str("user_id", u.MXID.String()).Msg("No device found for user, skipping Connect and sending BadCredentials BridgeState")
u.BridgeState.Send(status.BridgeState{StateEvent: status.StateBadCredentials, Message: "You have been logged out of Signal, please reconnect"})
continue
}
go u.Connect()
Expand Down

0 comments on commit 63b24c8

Please sign in to comment.