Merge branch 'next-minor' into develop

This commit is contained in:
Benjamin Neff 2018-02-22 00:49:32 +01:00
commit 0cb2a8f4d7
No known key found for this signature in database
GPG key ID: 971464C3F1A90194
4 changed files with 22 additions and 4 deletions

View file

@ -10,8 +10,10 @@
## Refactor
* Don't print a warning when starting the server outside a Git repo [#7712](https://github.com/diaspora/diaspora/pull/7712)
* Make script/server work on readonly filesystems [#7719](https://github.com/diaspora/diaspora/pull/7719)
## Bug fixes
* Prevent duplicate mention notifications when the post is received twice [#7721](https://github.com/diaspora/diaspora/pull/7721)
## Features
* Add basic html5 audio/video embedding support [#6418](https://github.com/diaspora/diaspora/pull/6418)

View file

@ -18,7 +18,10 @@ module Notifications
)
relevant_mentions.each do |mention|
create_notification(mention.person.owner, mention, actor).try(:email_the_user, mention, actor)
recipient = mention.person.owner
unless exists?(recipient: recipient, target: mention)
create_notification(recipient, mention, actor).try(:email_the_user, mention, actor)
end
end
end
end

View file

@ -99,7 +99,7 @@ fi
# Setup environment
if [ -z "$RAILS_ENV" ]
then
RAILS_ENV=$(bin/bundle exec ruby ./script/get_config.rb server.rails_environment)
RAILS_ENV=$(bin/bundle exec ruby ./script/get_config.rb server.rails_environment | grep -vE "is not writable|as your home directory temporarily" )
on_failure "Couldn't parse config/diaspora.yml!"
export RAILS_ENV
fi
@ -113,7 +113,8 @@ vars=$(bin/bundle exec ruby ./script/get_config.rb \
chat=chat.enabled \
chat_server=chat.server.enabled \
chat_bosh_proxy=chat.server.bosh.proxy \
redis_url=environment.redis
redis_url=environment.redis \
| grep -vE "is not writable|as your home directory temporarily"
)
on_failure "Couldn't parse config/diaspora.yml!"
eval "$vars"
@ -170,7 +171,7 @@ then
then
redis_param="url: '$redis_url'"
fi
if [ "$(bin/bundle exec ruby -e "require 'redis'; puts Redis.new($redis_param).ping" 2> /dev/null)" != "PONG" ]
if [ "$(bin/bundle exec ruby -e "require 'redis'; puts Redis.new($redis_param).ping" 2> /dev/null | grep -vE "is not writable|as your home directory temporarily" )" != "PONG" ]
then
fatal "Can't connect to redis. Please check if it's running and if environment.redis is configured correctly in config/diaspora.yml."
fi

View file

@ -51,5 +51,17 @@ describe Notifications::Mentioned do
expect(TestNotification).not_to receive(:create_notification)
TestNotification.notify(status_message, nil)
end
it "doesn't create notification if it already exists" do
status_message = FactoryGirl.create(:status_message, text: text_mentioning(alice), author: eve.person)
TestNotification.create(
recipient: alice,
target: Mention.where(mentions_container: status_message, person: alice.person_id).first,
actors: [status_message.author]
)
expect(TestNotification).not_to receive(:create_notification)
TestNotification.notify(status_message, nil)
end
end
end