lib/cinch/plugins/seen.rb in cinch-seen-1.0.2 vs lib/cinch/plugins/seen.rb in cinch-seen-1.0.3
- old
+ new
@@ -1,22 +1,19 @@
# -*- coding: utf-8 -*-
require 'cinch'
require 'cinch/toolbox'
-require 'cinch-storage'
+require 'cinch/storage'
require 'cinch/cooldown'
require 'time-lord'
module Cinch::Plugins
# plugin to allow users to see when other users were last active
class Seen
include Cinch::Plugin
- class Activity < Struct.new(:nick, :time, :message)
- def to_yaml
- { nick: nick, time: time, message: message }
- end
- end
+ # Simple object used to track users.
+ Activity = Struct.new(:nick, :time, :message)
enforce_cooldown
self.help = 'Use .seen <name> to see the last time that nick was active.'
@@ -24,10 +21,10 @@
match /seen ([^\s]+)\z/
def initialize(*args)
super
- @storage = CinchStorage.new(config[:filename] || 'yaml/seen.yml')
+ @storage = Cinch::Storage.new(config[:filename] || 'yaml/seen.yml')
@storage.data ||= {}
end
def listen(m)
channel = m.channel.name