diff options
author | pdp8 <pdp8@pdp8.info> | 2023-07-30 15:07:28 +0200 |
---|---|---|
committer | pdp8 <pdp8@pdp8.info> | 2023-07-30 15:07:28 +0200 |
commit | 3a8be7b1606885b3b94bc22a6d775a6527e1c07d (patch) | |
tree | 3aed49446c69d4a0c66e5f2eb6fca7ca181ef80e /server.rb | |
parent | fbd4fccc70622e664e2f795315c848d68aed365e (diff) |
note parsing, tag links
Diffstat (limited to 'server.rb')
-rw-r--r-- | server.rb | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -54,6 +54,10 @@ end end end +get '/tags/:tag' do |tag| + send_file(File.join(PUBLIC_DIR, 'tags', tag) + '.json', type: CONTENT_TYPE) +end + helpers do def create @object ||= @activity['object'] @@ -79,8 +83,15 @@ helpers do end def undo - halt 501 unless @activity['object']['type'] == 'Follow' - update_collection FOLLOWERS, @activity['object']['actor'], true + case @activity['object']['type'] + when 'Follow' + update_collection FOLLOWERS, @activity['object']['actor'], true + when 'Create', 'Announce' + file = find_file @activity['object']['id'] + FileUtils.rm(file) if File.exist? file + else + halt 501 + end end def update |