+12
app/firehose_stream.rb
+12
app/firehose_stream.rb
···
81
81
# use these events if you want to track handle changes:
82
82
# log "Handle change: #{msg.repo} => #{msg.handle}"
83
83
84
+
elsif msg.type == :account
85
+
# tracking account status changes, e.g. suspensions, deactivations and deletes
86
+
process_account_message(msg)
87
+
84
88
elsif msg.is_a?(Skyfall::Firehose::UnknownMessage)
85
89
log "Unknown message type: #{msg.type} (#{msg.seq})"
86
90
end
···
112
116
else
113
117
# other types like :bsky_block, :bsky_profile (includes profile edits)
114
118
end
119
+
end
120
+
end
121
+
122
+
def process_account_message(msg)
123
+
if msg.status == :deleted
124
+
# delete all data we have stored about this account
125
+
FeedPost.joins(:post).where(post: { repo: msg.did }).delete_all
126
+
Post.where(repo: msg.did).delete_all
115
127
end
116
128
end
117
129