SrainApp / srain

Modern IRC client written in GTK
https://srain.silverrainz.me/
Other
309 stars 35 forks source link

Let Identify/Login run before joining channels on reconnect... #274

Closed AlbinoGeek closed 2 years ago

AlbinoGeek commented 4 years ago

As it is now, channel rejoin happens immediately upon reconnect (from system resume, etc.) -- which means that joining channels with a +r literally doesn't work, as you are redirected to some other channel, and as a result, the chat log is cleared. Couple this with the fact the client has no real chat log, and you have a destructive experience.

It defeats the entire purpose of having the client save my NickServ / IDENT password.

SilverRainZ commented 4 years ago

Hello.

Let Identify/Login run before joining channels on reconnect

I thinks Srain already act like this now.

Are you login by typing /msg NickServ identify <password>?

AlbinoGeek commented 4 years ago

on reconnect is the issue here. I do not use the command explicitly because under the advanced tab of the main client, you can choose for the client to login for me. However, it tries to join channels before authenticating if the program is reconnecting.

Reconnection happens due to network loss or system resume from suspend.

SilverRainZ commented 4 years ago

Sorry for responsing so late.

I think i know where the problem is. Have you check the "remember password" togglebutton when you login?

AlbinoGeek commented 3 years ago

Right, I do have Remember Password toggled.

Again, this issue happens on reconnect specifically.

IRC flow should be:

CONNECT
USER
IDENT
LOGIN (NickServ, etc.)
JOIN (...)

srain flow is instead:

CONNECT
USER
JOIN (...) // fails because I'm not logged in and the channels require +r
IDENT
LOGIN (NickServ, etc.)
AlbinoGeek commented 3 years ago

Had I not explained the issue well enough?

Normal IRC clients will login before joining channels, srain does not.

Therefore, the channel joins fail (because they require +r)

SilverRainZ commented 3 years ago

Hi AlbinoGeek, you have explianed it well.

Couple this with the fact the client has no real chat log

Srain has chat log, see: https://doc.srain.im/en/latest/misc.html#chat-logs

srain flow is instead: ...

Srain's flow is almost same as other IRC client. but srain doesn't save you password in memory, it only query password from dbus secret service, you doesn't toggle "remember password", so srain get nothing, so you are no login when you reconnected. We can treat it as a bug, but how to fix it is debatable.

AlbinoGeek commented 3 years ago

I'm sure I've explained this poorly.

srain currently does reconnect and even login again, it does not forget my password, it even tries to rejoin all my channels -- the problem is that it does these things in the wrong order.

It needs to: login before joining channels.

Right now it: joins channels before logging in.

AlbinoGeek commented 3 years ago

Currently, when you resume your computer from standby, the following message will show up in every channel:

ERROR[477] You need a registered nick to join that channel.

Why? Because srain is rejoining channels before logging in.

And yes, it does in fact login, but only after NickServ asks it to. (e.g: it doesn't even attempt to pre-empt NickServ, even though it would know full well it was logged in before my computer was suspended...

The server log on a reconnect is as follows:

Server capabilities: unrealircd.org/plaintext-policy=user=allow,oper=warn,server=allow unrealircd.org/link-security=0 extended-join chghost cap-notify userhost-in-names multi-prefix away-notify account-notify sasl=PLAIN,AUTHCOOKIE tls

Requesting capabilities: cap-notify sasl 

Acknowledged capabilities: cap-notify sasl=PLAIN,AUTHCOOKIE

Logging in with msg-nickserv...

[ IRCd welcome message ]
[ IRCd extended welcome message ]
[ IRCd extended message of the day ]
[ InfoServ message of the day ]

// <-- srain attempts to join channels, and obviously fails

mode MyUsername +iwxzR  by MyUsername

// <-- srain should be attempting to join channels here, after the IRCd confirms a +R mode set....
SilverRainZ commented 3 years ago

SASL auth is always run before rejoin, but NickServ auth doesn't, I wil fix this recently.

cc @starsareintherose