Proper info.
authorlain <lain@soykaf.club>
Sat, 31 Mar 2018 19:00:23 +0000 (21:00 +0200)
committerlain <lain@soykaf.club>
Sat, 31 Mar 2018 19:00:23 +0000 (21:00 +0200)
lib/pleroma/gopher/server.ex

index 6a72e8dd0393405ca13f669c426f5a9ea972ea29..f72a0a472fb36f1fcc46ad98daf829297752af15 100644 (file)
@@ -50,8 +50,13 @@ defmodule Pleroma.Gopher.Server.ProtocolHandler do
   end
 
   def info(text) do
-    text = String.replace(text, ~r/[\t\r\n]/, " ")
-    "#{text}\tfake\(NULL)\t0\r\n"
+    text = String.replace(text, ~r/[\t\n]/, " ")
+    String.split(text, "\r")
+    |> Enum.map(fn (text) ->
+      "i#{text}\tfake\(NULL)\t0\r\n"
+      |> IO.inspect()
+    end)
+    |> Enum.join("")
   end
 
   def link(name, selector, type \\ 1) do