When someone uses the "|" convention, can this throw off the bequeathing (and... dequeathing) of karma? I'm sure it's not a huge problem when people are using obvious statuses like "nickname|afk" or "nickname|away", but my organization is considering using the vertical bar convention to add our company's name afterwards. I don't know about the other guys, but I'd still like any karma to be linked with my d.o username.

If I submitted a patch for the regex, might it be accepted?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Morbus Iff’s picture

Yes, | would throw off the karma - "user" is different from "user|afk" or "user|company".

The patch would have to hit two areas - "user|afk++", but also "karma user|afk?".

patcon’s picture

OK, and I just realized the the regex doesn't recognize "BOTNAME: USER++" with the colon (which many IRC clients add automatically). Is it ok if I add a change for that in the same patch? Oh, and the regex for giving karma is caps-sensitive, but it's not for requesting karma scores. I'm guessing that's unintentional.

patcon’s picture

Alright, so it's only 3 lines, but it changes these:

  1. A colon after the botname is now accepted for giving/removing karma. (eg. "Druplicon: MorbusIff++" now works)
  2. Giving/removing karma is no longer case-sensitive. (eg. "druplicon MorbusIff++" now works)
  3. Any portion of the IRC nick after the first vertical bar is discarded. (eg. "Druplicon MorbusIff|afk|etc++" now updates karma for "MorbusIff")
Morbus Iff’s picture

Regarding #2, incorrect. $addressed is created by bot_name_regexp() and contains : as well as a number of other possibilities.

Morbus Iff’s picture

Also regarding #2: not sure what you mean about case sensitivity. Any case should be acceptable for any request, as it's all strtolower'd before it hits the db (i.e. "MorbusIff++" is acceptable and is stored in the database as "morbusiff", such that any future request for "karma morbusiff? karma MorbusIff? karma MORBUSIFF?" will all return the same value. This is intentional.) If you're specifically talking about "/i", then this is also intentional - "KARMA morbusiff?" and "KarMa morbusiff?" should be quite OK.

patcon’s picture

Status: Active » Needs review
FileSize
1.15 KB

Cool. Just deals with #2 and #3 above, as per IRC.

mikebell_’s picture

My IRC nick is currently digita| (long story) all my karma is currently logged against this, would this then mean if someone did "digita|++" then "digita" would be credited?

It's not a major issue but I thought I'd bring it up.

Morbus Iff’s picture

In the current patch, it looks like, yes, your karma would be screwed (due to .* in the regexp).