Save incoming tags as lowercase.
authorRoger Braun <roger@rogerbraun.net>
Sun, 18 Jun 2017 17:01:54 +0000 (19:01 +0200)
committerRoger Braun <roger@rogerbraun.net>
Sun, 18 Jun 2017 17:01:54 +0000 (19:01 +0200)
lib/pleroma/web/ostatus/ostatus.ex
test/fixtures/ostatus_incoming_post_tag.xml

index df80d137a35b4f9518eda27088a96b9566b247ff..7fd3a5eddd127bdcc82f09ce30828499518df3c0 100644 (file)
@@ -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
index 695766d7387dfc4f7dfcfdc9996b45a35059edcd..5febb80d1df47add4f83058c38e8bfe0b1f577ca 100644 (file)
@@ -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>