Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nick-changing messes up gender tracking #92

Open
dgw opened this issue Nov 26, 2016 · 2 comments
Open

Nick-changing messes up gender tracking #92

dgw opened this issue Nov 26, 2016 · 2 comments

Comments

@dgw
Copy link
Collaborator

dgw commented Nov 26, 2016

Illustrative example first:

<ElimGarak> Kaede: what gender am I?
<Kaede> ElimGarak: Grammatically, I refer to you as androgynous. [snip]
<ElimGarak> Kaede: I am male
<Kaede> Okay, ElimGarak
	ElimGarak changed nick to GLaDOS
<GLaDOS> Kaede: what gender am I?
<Kaede> GLaDOS: Grammatically, I refer to you as male. [snip]
<GLaDOS> ok
<GLaDOS> Kaede: what gender is ElimGarak?
<Kaede> GLaDOS: I don't know how to refer to ElimGarak!

Following someone's /nicks is all well and good, but all too often someone changes nicks, leaves IRC, then comes back on their original nick—at which point Bucket no longer knows their grammatical gender. I was even asked, following the most recent occurrence of this: <DHMO_Mobile> dgw: Why is my gender moved from nick to nick, instead of copied though? Needless to say, I didn't have a good answer except that the current code does what it does.

I traced this to the main body of the irc_on_nick subroutine. Assuming that exists $stats{users}{genders}{lc $who}, that value is deleted and assigned to $stats{users}{genders}{lc $newnick}, and then the database is updated (&sql( "update genders set nick=? where nick=? limit 1", [ $newnick, $who ] );), at which point Bucket has completely forgotten about the old nick. (The old nick is $who and the new nick is $newnick.)

The best solution to Bucket's amnesic tendency isn't really clear, though. While the gender value could be copied to a new row instead of changing the nickname in the existing row, that would lead to having a bunch more rows in the genders table. Updating the grammatical gender for one nickname also wouldn't update any of the others used by the same person—and having the gender "magically" follow someone when they change nicknames wouldn't work then.

In my own work on plugins for the Sopel framework (which supports explicitly grouping nicknames to have them use the same preferences & stored values), I've been toying with the idea of writing a module that automatically merges nicks when users change names. But in my thought process for that concept, I'm hung up in the same place as I am here: Even if Bucket supported nickname groups, how can an automated merging process tell when a grouping should be temporary vs. permanent? When should the new name be ungrouped on PART/QUIT/KICK and when should it be left to persist? That's often a call only a human bot admin can make on a case-by-case basis.

But I've gotten into the weeds a bit. Here, the biggest issue for me is that when users go to the effort of telling Bucket their grammatical gender, that set value should persist no matter what nick-changes occur. Whether the solution is tracking nick-changes only in $stats{users}{genders} and leaving the DB alone, or something more sophisticated, I don't think the current behavior of just forgetting about the original nickname is ideal.

@dgw dgw added the discussion label Nov 26, 2016
@dgw
Copy link
Collaborator Author

dgw commented Dec 1, 2016

Addendum to the problem description:

  1. user sets gender to 'male'
  2. user changes nick to resu (Bucket updates DB entry with new name)
  3. resu quits IRC
  4. user joins IRC (Bucket does not know user's gender at this point)
  5. user sets gender to 'male' again
  6. user changes nick to resu
  7. Bucket outputs a DB error because he has tried to update user's name to resu, but there is already an entry with that nick

So not only does Bucket "forget" stuff he shouldn't, but he also throws out errors because of it. The only way I have found to resolve this is to manually delete the DB entry for either user or resu in the DB. Then it's fine until the next time user forgets to come back using the same nick as when they left…

@zigdon
Copy link
Owner

zigdon commented Feb 8, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants