Bug 132608 - Add option to defer auto-commands until certain conditions are met
Summary: Add option to defer auto-commands until certain conditions are met
Status: CONFIRMED
Alias: None
Product: konversation
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: Konversation Developers
URL:
Keywords:
: 140696 144279 211462 225712 258415 266250 310839 311540 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-08-18 20:52 UTC by Klaus Unger
Modified: 2013-02-06 05:45 UTC (History)
16 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Klaus Unger 2006-08-18 20:52:12 UTC
Version:           0.19 #3100 (using KDE 3.5.2, Kubuntu Package 4:3.5.2-0ubuntu18.1 dapper)
Compiler:          Target: i486-linux-gnu
OS:                Linux (i686) release 2.6.15-26-686

When connecting to the irc.netgamers.org network the network join command does not work. The reply to the issued commands is "not registered". I guess the command is sent to early during the connection.

This is really sad because there seems no way to autoidentify to this network, as their bot useses a uncommon syntax (/msg P@cservice.netgamers.org LOGIN nick passwd), also to cloack a "/mode nick +x" is required.
Comment 1 Eike Hein 2006-08-26 20:12:35 UTC
Rename for clarity.
Comment 2 Klaus Unger 2006-08-26 21:52:37 UTC
The problem seems that the command is not parsed but directly sent to the server. So /msg wont work, but PRIVMSG ... will do. The documentation should be fixed, it clearly states "/msg " as examle, the server response then is unknown command.

So it is not a timing issue but maybe a documentation / not parsed issue.
Comment 3 Eike Hein 2006-08-26 22:12:50 UTC
I rewrote "Commands" in SVN a couple of months ago - it does parse now. The timing issue exists regardless in a number of situations, though, so I chose to make this the bug for it.
Comment 4 Klaus Unger 2006-08-27 14:09:59 UTC
I just noticed that the problem especially exists when a nickname is already in use. The auto commands are sent before the alternate nickname.

P.S. I am using 0.19 #3100, wich is the latest available for Kubuntu.
Comment 5 Eike Hein 2007-01-27 02:01:11 UTC
Rename to serve as meta-bug.
Comment 6 Eike Hein 2007-01-27 02:01:28 UTC
*** Bug 140696 has been marked as a duplicate of this bug. ***
Comment 7 Eike Hein 2007-04-16 00:28:27 UTC
*** Bug 144279 has been marked as a duplicate of this bug. ***
Comment 8 Robert Buchholz 2007-07-20 20:25:13 UTC
The same goes for auto-join. It should only be run after fully identified to services, which is not the case right now.

On freenode, the following happens:

== Main window ==
[Notice] -NickServ- This nickname is owned by someone else
[Notice] -NickServ- If this is your nickname, type /msg NickServ IDENTIFY <password>
[Notice] -NickServ- Password accepted - you are now recognized
[Notice] -kornbluth.freenode.net- NickServ set your hostname to "gentoo/developer/rbu"

== Channel window ==
--> You have joined the channel #gentoo-dev (n=rbu@i59F773B4.versanet.de).

  while it should be
--> You have joined the channel #gentoo-dev (n=rbu@gentoo/developer/rbu).

Comment 9 Eike Hein 2007-07-20 23:48:38 UTC
For the record: The reason we're not currently doing this isn't because we're lazy or because we're stupid, but because it's non-trivial, or rather because the only "solutions" are extremely unattractive.

Authentication on IRC is essentially unstandardized, despite multiple efforts to correct that problem over the years (the latest of which is IRC+, which we're involved with to some degree). There's no reliable protocol by which to authenticate and wait for success or failure. 

The first thought tends to be "so just delay that stuff by a few seconds". That solution is undesirable for a number of reasons:
* If the amount of time to wait is fixed and too low, it enters the realm of being unreliable; creating potential race conditions due to variable latency.
* If the amount of time is fixed and too high, it's detrimental to the user experience: Connecting to a network takes longer for (to the user) unclear reasons.
* If the whole thing is to be optional and the delay configurable, we're dealing with an ugly option cluttering up the UI.

A better solution what we're calling "the contingency waiting scheme", which roughly works as follows:
* If the Auto-Identify fields are filled in, the authentification command is sent as early as possible in the connection process. Similarly, if one of the auto-connect Commands matches one in a list of known authentification message patterns, it's singled out and sent first.
* Auto-join and the other auto-connect commands are deferred until a timer set to a fixed amount times out. 
* If a known authentification success message is received prior to timeout (checked against a white list), the timeout is pre-empted and auto-join and commands commence immediately. The same for a known failure.

The reason that solution is undesirable is that it opens up the Pandora's Box of trying to abstract all the different services implementations out there by collecting their replies and shipping the lists in the app, and keeping them updated.

The third solution is to defer the problem to the user: Add a scripting interface that allows power users to upload some code into the app that disables automatic auto-join/commands and instead triggers it when recognizes an incoming message as an authentification success. I find that degree of customizability/scriptability to be desirable and we will strive to attain it, but as a solution to this problem it's ultimately rather user-unfriendly.

Thus we're currently leaning towards option #2, but implementing it is definitely not our idea of a good time.
Comment 10 Lloeki 2008-03-10 10:14:52 UTC
What's the status on this? I'm tired of typing '/join #python' on freenode because I get rejected.

My issue here is auto-join which is ATM totally unusable since all channels needing identification are flat out rejected.
99.9% of the time a 1000 ms delay between nickserv identification and autojoin commands is sufficient. I'm not in favor of defaulting to this delay, but please just make this delay user settable in either the 'edit network' dialog or the 'identities' dialog and make it default to zero, wich would reproduce current behavior while at the same time allowing for a trivial workaround. This will make things useable again while waiting for a more efficient solution.
Comment 11 Eike Hein 2008-03-10 14:11:33 UTC
On Freenode, you can use the network-specific workaround (although it has been adopted by other networks as well by now) of using the nickserv password as the server password, in which case the network will take care of it.
Comment 12 Lloeki 2008-03-10 15:36:38 UTC
Thanks for the tip. I'll make use of it at once.
Comment 13 Robert Buchholz 2008-03-10 16:51:30 UTC
Lloeki, any reason to remove the CCs?
Comment 14 Lloeki 2008-03-10 21:09:15 UTC
sorry, it was a mistake on my part. I was stupidly marveling at how the form worked and forgot to uncheck. apologies.
Comment 15 Peter Simonsson 2009-10-22 19:04:43 UTC
*** Bug 211462 has been marked as a duplicate of this bug. ***
Comment 16 Eike Hein 2010-02-06 13:09:47 UTC
*** Bug 225712 has been marked as a duplicate of this bug. ***
Comment 17 Navin 2010-09-21 19:58:06 UTC
It would help if "/sleep <seconds>" was a valid command in the Command window.  That way the user could delay the automated sending of commands.  Many telephones/cellphones have a similar concept for speed-dialing, where "t<number>#" causes a pause of <number> seconds, useful to get past menues.  E.g. 555-555-5555t11#2t3#5t2#7  would successfully dial a number, wait 11 second, dial 2, wait 3 seconds, dial 5, wait 2 seconds, dial 7.
Comment 18 Eike Hein 2010-11-30 19:22:29 UTC
*** Bug 258415 has been marked as a duplicate of this bug. ***
Comment 19 Eike Hein 2011-02-14 01:38:00 UTC
*** Bug 266250 has been marked as a duplicate of this bug. ***
Comment 20 Dirk Wallenstein 2011-12-03 17:26:54 UTC
Okay. It might be helpful if this information could be hinted at in the Identity dialog. Currently the user experience is suboptimal, too.  It could also enter the handbook.
Comment 21 Alex 2012-04-03 08:08:10 UTC
in konversation:
f2 (quick server list) > Freenode Server > under that irc.freenode.org <<---- there Edit.
enter your password there, and it helps
Comment 22 Eike Hein 2012-04-03 23:33:58 UTC
To expand on what Alex has said, and to provide information on what has changed in the next release:

- Authenticating via the server password is indeed supported by several networks. On Freenode, you can also enter "accountname:password" (with the colon but without the quotation marks) as the server password to authenticate independently of the nickname you are connecting with.

- To make this easier to discover the 1.5 release has a new Auto Identify UI in the Identities dialog. You can now choose among several types of authentication there, including "Server Password". If the server password is set via the identity this way, it will override the server settings.

- Additionally, we now support SASL PLAIN authentication, also configurable in the Identities dialog. This is now the recommended method to authenticate with services on networks that support it, including Freenode.

- And the "Standard NickServ" authentication type has been improved as well, making the command configurable (previously hard-coded to "identify").

- We also have plains to add support for authenticating with client certificates soon, supported e.g. by OFTC. At that point we will support basically all authentication options supported by networks today.
Comment 23 argonel 2012-11-28 20:26:14 UTC
*** Bug 310839 has been marked as a duplicate of this bug. ***
Comment 24 Eike Hein 2012-12-12 15:36:20 UTC
*** Bug 311540 has been marked as a duplicate of this bug. ***