Skip to content

Conversation

@Exirel
Copy link
Contributor

@Exirel Exirel commented Aug 28, 2020

Description

Basic implementation to fix #300 (no configuration, no alternative, nothing):

  1. on connection, if we receive a "nick already used" event, we change the current nick, adding an extra _ to its end
  2. on auth with a nickserv account, if bot.nick is not bot.settings.core.nick, we try to use NickServ GHOST
  3. when bot.settings.core.nick QUIT, we try to get back to that nick

Maybe this should be optional, maybe we could have a list of nick aliases to use for that purpose. But I wanted to show what is possible with the current state of the code. It tested it by using a copy of a config file, and checking that the second instance ghost the first one and get its nick back.

From another user point of view, here are the logs:

15:25:05 → Exibot joined (~Exibot@hostmask)
15:27:33 → Exibot_ joined (~Exibot@hostmask)
15:27:33 ⇐ Exibot quit (~Exibot@hostmask) Disconnected by services
15:27:34 Exibot_ → Exibot

After some discussions, I also fixed an improper use of the USER command, and made some minor code-style changes.

I'll do an Exirel and say: everything else is good for another PR!

Checklist

  • I have read CONTRIBUTING.md
  • I can and do license this contribution under the EFLv2
  • No issues are reported by make qa (runs make quality and make test)
  • I have tested the functionality of the things this change touches

@Exirel Exirel requested a review from dgw August 28, 2020 14:07
@Exirel Exirel added the Feature label Aug 28, 2020
@Exirel Exirel added this to the 7.1.0 milestone Aug 28, 2020
@Exirel
Copy link
Contributor Author

Exirel commented Aug 28, 2020

Note that it should fix #300 which is the current oldest issue we have for now.

@dgw dgw linked an issue Sep 14, 2020 that may be closed by this pull request
Copy link
Member

@dgw dgw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found a few nemeseS to slay. Despite a bit of doom and gloom in a couple of my line notes, this seems like a good approach. I'm just a bit mad at shortcomings of the IRC protocol and/or Sopel's threaded/async architecture. 😅

One other thing I couldn't touch in line notes because of GitHub's arbitrary restrictions:

./sopel/irc/__init__.py:49:1: F401 'sopel.tools.events' imported but unused

Exirel and others added 3 commits September 22, 2020 08:47
As discussed with @dgw on IRC, the proper USER command should be:

	USER <username> 0 * :<real name>

I tested on freenode and everything worked fine with that command.

Co-authored-by: dgw <[email protected]>
@Exirel Exirel force-pushed the handle-nick-already-used branch from 72440f6 to fe8059c Compare September 22, 2020 07:01
@Exirel Exirel marked this pull request as ready for review September 22, 2020 07:19
Copy link
Member

@dgw dgw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll probably forget to include the USER fix in release notes, but that's what updating PR titles is for. 🤪

@dgw dgw changed the title core: change and recover nick when already used core: change/recover in-use nick; fix obsolete USER command syntax Sep 23, 2020
@dgw dgw merged commit 11abde6 into sopel-irc:master Sep 23, 2020
@Exirel Exirel deleted the handle-nick-already-used branch May 1, 2021 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Quit after timeout from server

2 participants