From 30cd8991e8d810797e0df49c928d287392ab04b2 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sun, 13 Jan 2019 19:46:51 -0500 Subject: [PATCH] Pachyderm: Add StatusContentType --- Pachyderm/Client.swift | 2 ++ Pachyderm/Model/StatusContentType.swift | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 Pachyderm/Model/StatusContentType.swift diff --git a/Pachyderm/Client.swift b/Pachyderm/Client.swift index a60820f6..df4d6c7c 100644 --- a/Pachyderm/Client.swift +++ b/Pachyderm/Client.swift @@ -282,6 +282,7 @@ public class Client { } public func createStatus(text: String, + contentType: StatusContentType = .plain, inReplyTo: String? = nil, media: [Attachment]? = nil, sensitive: Bool? = nil, @@ -290,6 +291,7 @@ public class Client { language: String? = nil) -> Request { return Request(method: .post, path: "/api/v1/statuses", body: .parameters([ "status" => text, + "content_type" => contentType.mimeType, "in_reply_to_id" => inReplyTo, "sensitive" => sensitive, "spoiler_text" => spoilerText, diff --git a/Pachyderm/Model/StatusContentType.swift b/Pachyderm/Model/StatusContentType.swift new file mode 100644 index 00000000..c00b8e62 --- /dev/null +++ b/Pachyderm/Model/StatusContentType.swift @@ -0,0 +1,17 @@ +// +// StatusContentType.swift +// Pachyderm +// +// Created by Shadowfacts on 1/12/19. +// Copyright © 2019 Shadowfacts. All rights reserved. +// + +import Foundation + +public enum StatusContentType: String, Codable, CaseIterable { + case plain, markdown, html + + var mimeType: String { + return "text/" + rawValue + } +}