Skip to content

Commit

Permalink
Hopefully this gets rid of old messages appearing every once in a while.
Browse files Browse the repository at this point in the history
  • Loading branch information
ricktessner committed Apr 6, 2009
1 parent cc1cfda commit abe399d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions butane.rb
Expand Up @@ -9,11 +9,15 @@ def monitor_room(room, config = {})

room_name = room.name.gsub /"/, '' # Get rid of any dquotes since we use 'em to delimit person

last_message_id = 0
room.listen do |m|
# Ignore any pings from campfire to determine if I'm still
# here
next if m[:person].strip.empty? # Ignore anything from a nil / empty person

next if m[:id].to_i <= last_message_id
last_message_id = m[:id].to_i

delay = 5000 # in milliseconds (time to display the notification)

# If we're to monitor something in particular in this room, set the
Expand Down

0 comments on commit abe399d

Please sign in to comment.