Browse Source

Merge branch 'master' into glitch-soc/merge-upstream

Thibaut Girka 2 months ago
parent
commit
04e2c67389

+ 1
- 1
Gemfile View File

@@ -23,7 +23,7 @@ gem 'paperclip-av-transcoder', '~> 0.6'
23 23
 gem 'streamio-ffmpeg', '~> 3.0'
24 24
 
25 25
 gem 'active_model_serializers', '~> 0.10'
26
-gem 'addressable', '~> 2.5'
26
+gem 'addressable', '~> 2.6'
27 27
 gem 'bootsnap', '~> 1.3', require: false
28 28
 gem 'browser'
29 29
 gem 'charlock_holmes', '~> 0.7.6'

+ 9
- 9
Gemfile.lock View File

@@ -62,7 +62,7 @@ GEM
62 62
       i18n (>= 0.7, < 2)
63 63
       minitest (~> 5.1)
64 64
       tzinfo (~> 1.1)
65
-    addressable (2.5.2)
65
+    addressable (2.6.0)
66 66
       public_suffix (>= 2.0.2, < 4.0)
67 67
     airbrussh (1.3.0)
68 68
       sshkit (>= 1.6.1, != 1.7.0)
@@ -292,8 +292,8 @@ GEM
292 292
     json-ld (3.0.2)
293 293
       multi_json (~> 1.12)
294 294
       rdf (>= 2.2.8, < 4.0)
295
-    json-ld-preloaded (3.0.0)
296
-      json-ld (>= 2.2, < 4.0)
295
+    json-ld-preloaded (3.0.2)
296
+      json-ld (~> 3.0)
297 297
       multi_json (~> 1.12)
298 298
       rdf (~> 3.0)
299 299
     jsonapi-renderer (0.2.0)
@@ -365,7 +365,7 @@ GEM
365 365
       concurrent-ruby (~> 1.0, >= 1.0.2)
366 366
       sidekiq (>= 3.5)
367 367
       statsd-ruby (~> 1.4, >= 1.4.0)
368
-    oj (3.7.7)
368
+    oj (3.7.8)
369 369
     omniauth (1.9.0)
370 370
       hashie (>= 3.4.6, < 3.7.0)
371 371
       rack (>= 1.6.2, < 3)
@@ -391,7 +391,7 @@ GEM
391 391
     paperclip-av-transcoder (0.6.4)
392 392
       av (~> 0.9.0)
393 393
       paperclip (>= 2.5.2)
394
-    parallel (1.12.1)
394
+    parallel (1.13.0)
395 395
     parallel_tests (2.27.1)
396 396
       parallel
397 397
     parser (2.6.0.0)
@@ -422,7 +422,7 @@ GEM
422 422
       pry (>= 0.10.4)
423 423
     public_suffix (3.0.3)
424 424
     puma (3.12.0)
425
-    pundit (2.0.0)
425
+    pundit (2.0.1)
426 426
       activesupport (>= 3.0.0)
427 427
     raabro (1.1.6)
428 428
     rack (2.0.6)
@@ -515,7 +515,7 @@ GEM
515 515
     rspec-mocks (3.8.0)
516 516
       diff-lcs (>= 1.2.0, < 2.0)
517 517
       rspec-support (~> 3.8.0)
518
-    rspec-rails (3.8.1)
518
+    rspec-rails (3.8.2)
519 519
       actionpack (>= 3.0)
520 520
       activesupport (>= 3.0)
521 521
       railties (>= 3.0)
@@ -527,7 +527,7 @@ GEM
527 527
       rspec-core (~> 3.0, >= 3.0.0)
528 528
       sidekiq (>= 2.4.0)
529 529
     rspec-support (3.8.0)
530
-    rubocop (0.63.0)
530
+    rubocop (0.63.1)
531 531
       jaro_winkler (~> 1.5.1)
532 532
       parallel (~> 1.10)
533 533
       parser (>= 2.5, != 2.5.1.1)
@@ -657,7 +657,7 @@ PLATFORMS
657 657
 DEPENDENCIES
658 658
   active_model_serializers (~> 0.10)
659 659
   active_record_query_trace (~> 1.5)
660
-  addressable (~> 2.5)
660
+  addressable (~> 2.6)
661 661
   annotate (~> 2.7)
662 662
   aws-sdk-s3 (~> 1.30)
663 663
   better_errors (~> 2.5)

+ 12
- 0
app/javascript/styles/mastodon/about.scss View File

@@ -845,6 +845,18 @@ $small-breakpoint: 960px;
845 845
       margin-bottom: 0;
846 846
     }
847 847
 
848
+    strong {
849
+      display: inline;
850
+      margin: 0;
851
+      padding: 0;
852
+      font-weight: 700;
853
+      background: transparent;
854
+      font-family: inherit;
855
+      font-size: inherit;
856
+      line-height: inherit;
857
+      color: lighten($darker-text-color, 10%);
858
+    }
859
+
848 860
     .account {
849 861
       border-bottom: 0;
850 862
       padding: 0;

+ 1
- 1
app/javascript/styles/mastodon/reset.scss View File

@@ -54,7 +54,7 @@ table {
54 54
 }
55 55
 
56 56
 html {
57
-  scrollbar-color: lighten($ui-base-color, 4%) transparent;
57
+  scrollbar-color: lighten($ui-base-color, 4%) rgba($base-overlay-background, 0.1);
58 58
 }
59 59
 
60 60
 ::-webkit-scrollbar {

+ 4
- 1
app/services/post_status_service.rb View File

@@ -69,7 +69,10 @@ class PostStatusService < BaseService
69 69
   end
70 70
 
71 71
   def schedule_status!
72
-    if @account.statuses.build(status_attributes).valid?
72
+    status_for_validation = @account.statuses.build(status_attributes)
73
+    if status_for_validation.valid?
74
+      status_for_validation.destroy
75
+
73 76
       # The following transaction block is needed to wrap the UPDATEs to
74 77
       # the media attachments when the scheduled status is created
75 78
 

+ 1
- 1
app/services/verify_link_service.rb View File

@@ -10,7 +10,7 @@ class VerifyLinkService < BaseService
10 10
     return unless link_back_present?
11 11
 
12 12
     field.mark_verified!
13
-  rescue HTTP::Error, Addressable::URI::InvalidURIError, Mastodon::HostValidationError, Mastodon::LengthValidationError => e
13
+  rescue OpenSSL::SSL::SSLError, HTTP::Error, Addressable::URI::InvalidURIError, Mastodon::HostValidationError, Mastodon::LengthValidationError => e
14 14
     Rails.logger.debug "Error fetching link #{@url}: #{e}"
15 15
     nil
16 16
   end

+ 14
- 0
spec/services/post_status_service_spec.rb View File

@@ -36,6 +36,20 @@ RSpec.describe PostStatusService, type: :service do
36 36
     expect(status.params['text']).to eq 'Hi future!'
37 37
   end
38 38
 
39
+  it 'does not immediately create a status when scheduling a status' do
40
+    account = Fabricate(:account)
41
+    media = Fabricate(:media_attachment)
42
+    future  = Time.now.utc + 2.hours
43
+
44
+    status = subject.call(account, text: 'Hi future!', media_ids: [media.id], scheduled_at: future)
45
+
46
+    expect(status).to be_a ScheduledStatus
47
+    expect(status.scheduled_at).to eq future
48
+    expect(status.params['text']).to eq 'Hi future!'
49
+    expect(media.reload.status).to be_nil
50
+    expect(Status.where(text: 'Hi future!').exists?).to be_falsey
51
+  end
52
+
39 53
   it 'creates response to the original status of boost' do
40 54
     boosted_status = Fabricate(:status)
41 55
     in_reply_to_status = Fabricate(:status, reblog: boosted_status)

Loading…
Cancel
Save