summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMatthias Hecker <apoc@geekosphere.org>2015-06-24 19:19:07 +0000
committerMatthias Hecker <apoc@geekosphere.org>2015-06-24 19:19:07 +0000
commit763a7f968063fa993bb63f7b31ad69f73212c53b (patch)
treec8fc8f7a4a8be34df786d9762413ffd78ff87308 /lib
parent39503c481daf957c741db89767295a444973986d (diff)
journal: move journal accessor in coremodule
Diffstat (limited to 'lib')
-rw-r--r--lib/rbot/core/journal.rb11
-rw-r--r--lib/rbot/ircbot.rb7
-rw-r--r--lib/rbot/journal.rb1
3 files changed, 12 insertions, 7 deletions
diff --git a/lib/rbot/core/journal.rb b/lib/rbot/core/journal.rb
index 4bd4ec3c..c4f5f0f4 100644
--- a/lib/rbot/core/journal.rb
+++ b/lib/rbot/core/journal.rb
@@ -7,6 +7,17 @@
require 'rbot/journal'
+module ::Irc
+class Bot
+ # this should return the journal if the managing plugin has been loaded.
+ def journal
+ if @plugins['journal']
+ @plugins['journal'].broker
+ end
+ end
+end
+end
+
class JournalModule < CoreBotModule
attr_reader :broker
diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb
index 46e4faaa..739aaade 100644
--- a/lib/rbot/ircbot.rb
+++ b/lib/rbot/ircbot.rb
@@ -226,13 +226,6 @@ class Bot
myself.channels
end
- # returns the journal
- def journal
- if @plugins['journal']
- @plugins['journal'].broker
- end
- end
-
# nick wanted by the bot. This defaults to the irc.nick config value,
# but may be overridden by a manual !nick command
def wanted_nick
diff --git a/lib/rbot/journal.rb b/lib/rbot/journal.rb
index 9f586f7f..fe6c14be 100644
--- a/lib/rbot/journal.rb
+++ b/lib/rbot/journal.rb
@@ -278,6 +278,7 @@ module Journal
class JournalBroker
+ attr_reader :storage
class Subscription
attr_reader :topic
attr_reader :block