Skip to content

Commit

Permalink
Send error notice if user switches to google account pairing
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Dec 13, 2023
1 parent 47fc0a1 commit 62bf2e6
Show file tree
Hide file tree
Showing 6 changed files with 194 additions and 69 deletions.
3 changes: 3 additions & 0 deletions bridgestate.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ const (
GMBrowserInactiveInactivity status.BridgeStateErrorCode = "gm-browser-inactive-inactivity"

GMPhoneNotResponding status.BridgeStateErrorCode = "gm-phone-not-responding"

GMSwitchedToGoogleLogin status.BridgeStateErrorCode = "gm-switched-to-google-login"
)

func init() {
Expand All @@ -52,6 +54,7 @@ func init() {
GMBrowserInactiveTimeout: "Google Messages disconnected due to timeout",
GMBrowserInactiveInactivity: "Google Messages disconnected due to inactivity",
GMPhoneNotResponding: "Your phone is not responding, please check that it is connected to the internet. You may need to open the Messages app on your phone for it to reconnect.",
GMSwitchedToGoogleLogin: "Please switch to the QR code pairing method in the Google Messages app to continue using SMS/RCS",
})
}

Expand Down
4 changes: 4 additions & 0 deletions libgm/event_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,10 @@ func (c *Client) handleUpdatesEvent(msg *IncomingRPCMessage) {
}
c.triggerEvent(evt.TypingEvent.GetData())

case *gmproto.UpdateEvents_AccountChange:
c.logContent(msg, "", nil)
c.triggerEvent(evt.AccountChange)

default:
c.Logger.Warn().
Str("evt_data", base64.StdEncoding.EncodeToString(msg.DecryptedData)).
Expand Down
Loading

0 comments on commit 62bf2e6

Please sign in to comment.