mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-23 00:06:21 +00:00
feat: announce y like
This commit is contained in:
parent
1e44fba4b3
commit
f4379b45c2
3 changed files with 28 additions and 0 deletions
8
app/models/activity_pub/activity/announce.rb
Normal file
8
app/models/activity_pub/activity/announce.rb
Normal file
|
@ -0,0 +1,8 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ActivityPub
|
||||
class Activity
|
||||
# Boost
|
||||
class Announce < ActivityPub::Activity; end
|
||||
end
|
||||
end
|
8
app/models/activity_pub/activity/like.rb
Normal file
8
app/models/activity_pub/activity/like.rb
Normal file
|
@ -0,0 +1,8 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ActivityPub
|
||||
class Activity
|
||||
# Like
|
||||
class Like < ActivityPub::Activity; end
|
||||
end
|
||||
end
|
12
db/migrate/20240314205923_fix_activity_type.rb
Normal file
12
db/migrate/20240314205923_fix_activity_type.rb
Normal file
|
@ -0,0 +1,12 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Soportar nuevos tipos
|
||||
class FixActivityType < ActiveRecord::Migration[6.1]
|
||||
def up
|
||||
%w[Like Announce].each do |type|
|
||||
ActivityPub::Activity.where(Arel.sql("content->>'type' = '#{type}'")).update_all(type: "ActivityPub::Activity::#{type}", updated_at: Time.now)
|
||||
end
|
||||
end
|
||||
|
||||
def down; end
|
||||
end
|
Loading…
Reference in a new issue