Skip to content

Commit

Permalink
Fixed issue zammad#1606 - Ignore Twitter search key with only #.
Browse files Browse the repository at this point in the history
  • Loading branch information
martini committed Nov 3, 2017
1 parent b82b037 commit 766bf54
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/models/channel/driver/twitter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ def stream_start
hashtags = []
sync['search'].each do |item|
next if item['term'].blank?
next if item['term'] == '#'
next if item['group_id'].blank?
hashtags.push item['term']
end
Expand Down Expand Up @@ -275,6 +276,7 @@ def stream_start
hit = false
sync['search'].each do |item|
next if item['term'].blank?
next if item['term'] == '#'
next if item['group_id'].blank?
tweet.hashtags.each do |hashtag|
next if item['term'] !~ /^#/
Expand All @@ -295,6 +297,7 @@ def stream_start
body = tweet.text
sync['search'].each do |item|
next if item['term'].blank?
next if item['term'] == '#'
next if item['group_id'].blank?
if body =~ /#{item['term']}/
hit = item
Expand All @@ -314,6 +317,7 @@ def fetch_search
return if @sync[:search].blank?
@sync[:search].each do |search|
next if search[:term].blank?
next if search[:term] == '#'
next if search[:group_id].blank?
result_type = search[:type] || 'mixed'
Rails.logger.debug " - searching for '#{search[:term]}'"
Expand Down

0 comments on commit 766bf54

Please sign in to comment.