-
Notifications
You must be signed in to change notification settings - Fork 30
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
Fixes cosmetic issue where the karma message target should match the … #278
base: master
Are you sure you want to change the base?
Conversation
…requested target i.e., "~karma FoO" should say "FoO has karma 0" and not the normalized "foo has karma 0"
@@ -88,10 +88,10 @@ class KarmaOperation @Inject constructor(bot: Javabot, adminDao: AdminDao, var d | |||
} | |||
increment = false | |||
} | |||
var karma: Karma? = dao.find(nick) | |||
var karma: Karma? = dao.find(nick.toLowerCase()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this search is already case insensitive. it, in fact, upper cases the name before querying.
if (karma == null) { | ||
karma = Karma() | ||
karma.name = nick | ||
karma.name = nick.toLowerCase() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this also feels unnecessary
val nick = message.substring("karma ".length).toLowerCase() | ||
val karma = dao.find(nick) | ||
val nick = message.substring("karma ".length) | ||
val normalizedNick=nick.toLowerCase() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto. the search already ignores case. lowercasing it is redundant. ( i know it was that way before but it was wrong then, too)
@dependabot recreate |
1 similar comment
@dependabot recreate |
This has been updated, but I can't build it. |
…requested target
i.e., "~karma FoO" should say "FoO has karma 0" and not the normalized "foo has karma 0"