diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2007-01-23 16:24:29 +0000 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2007-01-23 16:24:29 +0000 |
commit | ac72e77fcb2c9ea9bbae67476b2d66458586926a (patch) | |
tree | f47f53f640297ae8ba7845c91cff63d9b6c93dd7 /data/rbot/plugins/salut.rb | |
parent | cb722191584309094ce0a57b95000e2e0751988d (diff) |
salut only saves its data files when they were changed (i.e. never, presently)
Diffstat (limited to 'data/rbot/plugins/salut.rb')
-rw-r--r-- | data/rbot/plugins/salut.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/data/rbot/plugins/salut.rb b/data/rbot/plugins/salut.rb index 6b16a745..a74504f6 100644 --- a/data/rbot/plugins/salut.rb +++ b/data/rbot/plugins/salut.rb @@ -1,5 +1,8 @@ # vim: set sw=2 et:
# Salutations plugin: respond to salutations
+# TODO allow online editing of salutations
+# TODO *REMEMBER* to set @changed to true after edit
+# TODO or changes won't be saved
unless Array.respond_to?(:pick_one)
debug "Defining the pick_one method for Array"
@@ -31,6 +34,7 @@ class SalutPlugin < Plugin @main_lang_str = nil
@main_lang = nil
@all_langs = true
+ @changed = false
super
reload
end
@@ -144,6 +148,7 @@ class SalutPlugin < Plugin @salutations[@main_lang] = load_lang(@main_lang_str)
end
create_match
+ @changed = false
end
def load_lang(lang)
@@ -169,6 +174,7 @@ class SalutPlugin < Plugin def save
return if @salutations.empty?
+ return unless @changed
@salutations.each { |lang, val|
l = lang.to_s
save_lang(lang, val)
|