Permalink
Browse files

added options for updating only statuses or only journal entries

  • Loading branch information...
1 parent d441fea commit f80216fd6d7ff3d48fa4ad4981a51527ebe8c1fd James MacAulay committed Jul 16, 2008
Showing with 4 additions and 2 deletions.
  1. +2 −2 backfire.rb
  2. +2 −0 config.example.yml
View
@@ -63,7 +63,7 @@ def self.update_campfire
puts "*** update_campfire"
latest_updated_at = self.last_updated_at || Time.at(0)
statuses = Status.all
- entries = JournalEntry.new_entries
+ entries = config['campfire']['update_journal_entries'] ? JournalEntry.new_entries : []
unless entries.empty? && self.last_updated_at && !(statuses.find {|s| s.updated_at > self.last_updated_at})
update = ''
(entries + statuses).group_by(&:user).each do |user_array|
@@ -73,7 +73,7 @@ def self.update_campfire
user_entries = user_entries.sort {|a,b| b.updated_at <=> a.updated_at }
latest_updated_at = status.updated_at if status and status.updated_at > latest_updated_at
latest_updated_at = user_entries.first.updated_at if user_entries.first and user_entries.first.updated_at > latest_updated_at
- unless user_entries.empty? and (self.last_updated_at ? status.updated_at <= self.last_updated_at : true)
+ unless user_entries.empty? and (!(config['campfire']['update_statuses']) or (self.last_updated_at ? status.updated_at <= self.last_updated_at : true))
update << "\n#{user.name}: #{status.message unless user_statuses.empty?}\n"
user_entries.each do |entry|
update << " * #{entry.body}\n"
View
@@ -7,6 +7,8 @@ campfire:
password: 'secret'
default_room: 1234
test_mode: false
+ update_statuses: true
+ update_journal_entries: true
ssl: true
backpack:

0 comments on commit f80216f

Please sign in to comment.