Template of a custom feed generator service for the Bluesky network in Ruby

support for info and handle message types

Changed files
+13 -3
app
+13 -3
app/firehose_stream.rb
··· 68 68 end 69 69 70 70 def handle_message(msg) 71 - if msg.seq % 10 == 0 72 - save_cursor(msg.seq) 71 + if msg.is_a?(Skyfall::InfoMessage) 72 + # AtProto error, the only one right now is "OutdatedCursor" 73 + puts "InfoMessage: #{msg}" 74 + elsif msg.is_a?(Skyfall::HandleMessage) 75 + # use these events if you want to track handle changes: 76 + # puts "Handle change: #{msg.repo} => #{msg.handle}" 77 + elsif msg.is_a?(Skyfall::UnknownMessage) 78 + puts "Unknown message type: #{msg.type}" 79 + elsif msg.type != :commit 80 + return 73 81 end 74 82 75 83 if @replaying ··· 77 85 @replaying = false 78 86 end 79 87 80 - return if msg.type != :commit 88 + if msg.seq % 10 == 0 89 + save_cursor(msg.seq) 90 + end 81 91 82 92 msg.operations.each do |op| 83 93 case op.type