Merge branch 'next-minor' into develop
This commit is contained in:
commit
0cb2a8f4d7
4 changed files with 22 additions and 4 deletions
|
|
@ -10,8 +10,10 @@
|
||||||
|
|
||||||
## Refactor
|
## Refactor
|
||||||
* Don't print a warning when starting the server outside a Git repo [#7712](https://github.com/diaspora/diaspora/pull/7712)
|
* 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
|
## Bug fixes
|
||||||
|
* Prevent duplicate mention notifications when the post is received twice [#7721](https://github.com/diaspora/diaspora/pull/7721)
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
* Add basic html5 audio/video embedding support [#6418](https://github.com/diaspora/diaspora/pull/6418)
|
* Add basic html5 audio/video embedding support [#6418](https://github.com/diaspora/diaspora/pull/6418)
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,10 @@ module Notifications
|
||||||
)
|
)
|
||||||
|
|
||||||
relevant_mentions.each do |mention|
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@ fi
|
||||||
# Setup environment
|
# Setup environment
|
||||||
if [ -z "$RAILS_ENV" ]
|
if [ -z "$RAILS_ENV" ]
|
||||||
then
|
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!"
|
on_failure "Couldn't parse config/diaspora.yml!"
|
||||||
export RAILS_ENV
|
export RAILS_ENV
|
||||||
fi
|
fi
|
||||||
|
|
@ -113,7 +113,8 @@ vars=$(bin/bundle exec ruby ./script/get_config.rb \
|
||||||
chat=chat.enabled \
|
chat=chat.enabled \
|
||||||
chat_server=chat.server.enabled \
|
chat_server=chat.server.enabled \
|
||||||
chat_bosh_proxy=chat.server.bosh.proxy \
|
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!"
|
on_failure "Couldn't parse config/diaspora.yml!"
|
||||||
eval "$vars"
|
eval "$vars"
|
||||||
|
|
@ -170,7 +171,7 @@ then
|
||||||
then
|
then
|
||||||
redis_param="url: '$redis_url'"
|
redis_param="url: '$redis_url'"
|
||||||
fi
|
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
|
then
|
||||||
fatal "Can't connect to redis. Please check if it's running and if environment.redis is configured correctly in config/diaspora.yml."
|
fatal "Can't connect to redis. Please check if it's running and if environment.redis is configured correctly in config/diaspora.yml."
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -51,5 +51,17 @@ describe Notifications::Mentioned do
|
||||||
expect(TestNotification).not_to receive(:create_notification)
|
expect(TestNotification).not_to receive(:create_notification)
|
||||||
TestNotification.notify(status_message, nil)
|
TestNotification.notify(status_message, nil)
|
||||||
end
|
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
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue