Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Get seen case insensitive #92

merged 2 commits into from

2 participants


lazybot doesn't convert nicks to lowercase whenever it looks up and updates nicknames. This pull request convert nicknames to lowercase before storing and updating them.

Note that this doesn't automatically convert nicks already stored, so proper removal of nicks should be done if one really cares about the correctness of this plugin.

@Raynes Raynes merged commit 6c592a3 into Raynes:master
@hyPiRion hyPiRion deleted the hyPiRion:get-seen-case-insensitive branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 5 deletions.
  1. +7 −5 src/lazybot/plugins/seen.clj
12 src/lazybot/plugins/seen.clj
@@ -1,7 +1,7 @@
(ns lazybot.plugins.seen
(:use [lazybot registry info]
[lazybot.utilities :only [format-time]]
- [somnium.congomongo :only [fetch fetch-one insert! destroy!]]
+ [somnium.congomongo :only [fetch fetch-one insert! destroy!]]
[clojure.string :only [join]]))
(defn now []
@@ -11,21 +11,23 @@
"Takes a nick and updates the seen database with that nick and the current time."
[nick server channel doing]
(let [lower-nick (.toLowerCase nick)]
- (destroy! :seen {:nick nick :server server})
+ (destroy! :seen {:nick lower-nick :server server})
(insert! :seen
{:server server
:time (now)
:chan channel
:doing doing
- :nick nick})))
+ :nick lower-nick})))
(defn get-seen
"Gets the last-seen for a nick."
[nick server]
- (when-let [seen-map (fetch-one :seen :where {:nick nick :server server})]
+ (when-let [seen-map (fetch-one :seen :where {:nick (.toLowerCase nick)
+ :server server})]
(update-in seen-map [:time] #(- (now) %))))
-(defn put-seen [{:keys [nick channel com]} doing] (tack-time nick (:server @com) channel doing))
+(defn put-seen [{:keys [nick channel com]} doing]
+ (tack-time nick (:server @com) channel doing))
(:hook :on-message
Something went wrong with that request. Please try again.