Commit d0fcdc25 authored by Benjamin Neff's avatar Benjamin Neff

Only backport mention syntax when the author is local

We don't need to change new to old syntax when we receive a post from a
newer pod, since we can handle the new syntax. This is only needed when
sending it to older pods.

related to #7392
parent 06b61b64
......@@ -5,7 +5,7 @@ module Diaspora
included do
before_create do
# TODO: remove when most of the posts can handle the new syntax
self.text = Diaspora::Mentionable.backport_mention_syntax(text) if text
self.text = Diaspora::Mentionable.backport_mention_syntax(text) if text && author.local?
after_create :create_mentions
......@@ -18,6 +18,13 @@ shared_examples_for "it is mentions container" do
expect(obj.text).to eq(expected_text)
it "doesn't backport mention syntax if author is not local" do
text = "mention @{#{people[0].diaspora_handle}} text"
obj =, text: text, author: remote_raphael)
expect(obj.text).to eq(text)
describe ".after_create" do
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment