Skip to content

Commit 18bb9ed

Browse files
Gargronhiyuki2578
authored andcommitted
Fix non-lowercase hashtags not being picked up by the streaming API (mastodon#11508)
Regression from f371b32 Fix hashtag links always being lowercase
1 parent 3551162 commit 18bb9ed

5 files changed

Lines changed: 8 additions & 8 deletions

File tree

app/javascript/mastodon/components/status_content.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export default class StatusContent extends React.PureComponent {
112112
}
113113

114114
onHashtagClick = (hashtag, e) => {
115-
hashtag = hashtag.replace(/^#/, '').toLowerCase();
115+
hashtag = hashtag.replace(/^#/, '');
116116

117117
if (this.context.router && e.button === 0 && !(e.ctrlKey || e.metaKey)) {
118118
e.preventDefault();

app/lib/formatter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ def link_html(url)
300300
end
301301

302302
def hashtag_html(tag)
303-
"<a href=\"#{encode(tag_url(tag.downcase))}\" class=\"mention hashtag\" rel=\"tag\">#<span>#{encode(tag)}</span></a>"
303+
"<a href=\"#{encode(tag_url(tag))}\" class=\"mention hashtag\" rel=\"tag\">#<span>#{encode(tag)}</span></a>"
304304
end
305305

306306
def mention_html(account)

app/services/batched_remove_status_service.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ def unpush_from_public_timelines(status)
8080
end
8181

8282
@tags[status.id].each do |hashtag|
83-
redis.publish("timeline:hashtag:#{hashtag}", payload)
84-
redis.publish("timeline:hashtag:#{hashtag}:local", payload) if status.local?
83+
redis.publish("timeline:hashtag:#{hashtag.mb_chars.downcase}", payload)
84+
redis.publish("timeline:hashtag:#{hashtag.mb_chars.downcase}:local", payload) if status.local?
8585
end
8686
end
8787
end

app/services/fan_out_on_write_service.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ def deliver_to_hashtags(status)
7272
Rails.logger.debug "Delivering status #{status.id} to hashtags"
7373

7474
status.tags.pluck(:name).each do |hashtag|
75-
Redis.current.publish("timeline:hashtag:#{hashtag}", @payload)
76-
Redis.current.publish("timeline:hashtag:#{hashtag}:local", @payload) if status.local?
75+
Redis.current.publish("timeline:hashtag:#{hashtag.mb_chars.downcase}", @payload)
76+
Redis.current.publish("timeline:hashtag:#{hashtag.mb_chars.downcase}:local", @payload) if status.local?
7777
end
7878
end
7979

app/services/remove_status_service.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ def remove_from_hashtags
124124
return unless @status.public_visibility?
125125

126126
@tags.each do |hashtag|
127-
redis.publish("timeline:hashtag:#{hashtag}", @payload)
128-
redis.publish("timeline:hashtag:#{hashtag}:local", @payload) if @status.local?
127+
redis.publish("timeline:hashtag:#{hashtag.mb_chars.downcase}", @payload)
128+
redis.publish("timeline:hashtag:#{hashtag.mb_chars.downcase}:local", @payload) if @status.local?
129129
end
130130
end
131131

0 commit comments

Comments
 (0)