Fix stuck logout

This commit is contained in:
Bohdan Horbeshko 2024-01-24 18:54:25 -05:00
parent b40ccf4a4d
commit b9b6ba14a4
4 changed files with 8 additions and 6 deletions

2
go.mod
View file

@ -34,4 +34,4 @@ require (
)
replace gosrc.io/xmpp => dev.narayana.im/narayana/go-xmpp v0.0.0-20220524203317-306b4ff58e8f
replace github.com/zelenin/go-tdlib => dev.narayana.im/narayana/go-tdlib v0.0.0-20231111182840-bc2f985e6268
replace github.com/zelenin/go-tdlib => dev.narayana.im/narayana/go-tdlib v0.0.0-20240124222245-b4c12addb061

2
go.sum
View file

@ -3,6 +3,8 @@ dev.narayana.im/narayana/go-tdlib v0.0.0-20230730021136-47da33180615 h1:RRUZJSro
dev.narayana.im/narayana/go-tdlib v0.0.0-20230730021136-47da33180615/go.mod h1:Xs8fXbk5n7VaPyrSs9DP7QYoBScWYsjX+lUcWmx1DIU=
dev.narayana.im/narayana/go-tdlib v0.0.0-20231111182840-bc2f985e6268 h1:NCbc2bYuUGQsb/3z5SCIia3N34Ktwq3FwaUAfgF/WEU=
dev.narayana.im/narayana/go-tdlib v0.0.0-20231111182840-bc2f985e6268/go.mod h1:Xs8fXbk5n7VaPyrSs9DP7QYoBScWYsjX+lUcWmx1DIU=
dev.narayana.im/narayana/go-tdlib v0.0.0-20240124222245-b4c12addb061 h1:CWAQT74LwQne/3Po5KXDvudu3N0FBWm3XZZZhtl5j2w=
dev.narayana.im/narayana/go-tdlib v0.0.0-20240124222245-b4c12addb061/go.mod h1:Xs8fXbk5n7VaPyrSs9DP7QYoBScWYsjX+lUcWmx1DIU=
dev.narayana.im/narayana/go-xmpp v0.0.0-20220524203317-306b4ff58e8f h1:6249ajbMjgYz53Oq0IjTvjHXbxTfu29Mj1J/6swRHs4=
dev.narayana.im/narayana/go-xmpp v0.0.0-20220524203317-306b4ff58e8f/go.mod h1:L3NFMqYOxyLz3JGmgFyWf7r9htE91zVGiK40oW4RwdY=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=

View file

@ -68,10 +68,10 @@ func (stateHandler *clientAuthorizer) Handle(c *client.Client, state client.Auth
return nil
case client.TypeAuthorizationStateLoggingOut:
return client.ErrNotSupportedAuthorizationState
return nil
case client.TypeAuthorizationStateClosing:
return client.ErrNotSupportedAuthorizationState
return nil
case client.TypeAuthorizationStateClosed:
return client.ErrNotSupportedAuthorizationState

View file

@ -362,10 +362,10 @@ func (c *Client) getMessageReply(message *client.Message, preview bool, noConten
if message.ReplyTo != nil && message.ReplyTo.MessageReplyToType() == client.TypeMessageReplyToMessage {
replyTo, _ := message.ReplyTo.(*client.MessageReplyToMessage)
var text string
if replyTo.Quote != nil && !noContent {
if replyTo.Quote != nil && replyTo.Quote.Text != nil && !noContent {
text = formatter.Format(
replyTo.Quote.Text,
replyTo.Quote.Entities,
replyTo.Quote.Text.Text,
replyTo.Quote.Text.Entities,
c.getFormatter(),
)
// make the whole quote fit one line