aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Braun <roger@rogerbraun.net>2017-06-18 19:01:54 +0200
committerRoger Braun <roger@rogerbraun.net>2017-06-18 19:01:54 +0200
commit5ff4a5eee3e76ba05dc80868350bb7b3698113d0 (patch)
treef1bf27559f02786ba38f179b23baf866b756850e
parentfa828229326c5c0d8fc2d119e8cf0d70a63c5ef9 (diff)
downloadpleroma-5ff4a5eee3e76ba05dc80868350bb7b3698113d0.tar.gz
Save incoming tags as lowercase.
-rw-r--r--lib/pleroma/web/ostatus/ostatus.ex2
-rw-r--r--test/fixtures/ostatus_incoming_post_tag.xml2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/pleroma/web/ostatus/ostatus.ex b/lib/pleroma/web/ostatus/ostatus.ex
index df80d137a..7fd3a5edd 100644
--- a/lib/pleroma/web/ostatus/ostatus.ex
+++ b/lib/pleroma/web/ostatus/ostatus.ex
@@ -149,7 +149,7 @@ defmodule Pleroma.Web.OStatus do
def get_tags(entry) do
:xmerl_xpath.string('//category', entry)
- |> Enum.map(fn (category) -> string_from_xpath("/category/@term", category) end)
+ |> Enum.map(fn (category) -> string_from_xpath("/category/@term", category) |> String.downcase end)
end
def maybe_update(doc, user) do
diff --git a/test/fixtures/ostatus_incoming_post_tag.xml b/test/fixtures/ostatus_incoming_post_tag.xml
index 695766d73..5febb80d1 100644
--- a/test/fixtures/ostatus_incoming_post_tag.xml
+++ b/test/fixtures/ostatus_incoming_post_tag.xml
@@ -42,7 +42,7 @@
<id>tag:social.heldscal.la,2017-04-29:noticeId=1967725:objectType=note</id>
<title>New note by lambadalambda</title>
<content type="html">Will it blend?</content>
- <category term="nsfw"/>
+ <category term="Nsfw"/>
<link rel="alternate" type="text/html" href="https://social.heldscal.la/notice/1967725"/>
<status_net notice_id="1967725"></status_net>
<activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>