Pachyderm: Add StatusContentType

This commit is contained in:
Shadowfacts 2019-01-13 19:46:51 -05:00
parent 07a79657a7
commit 30cd8991e8
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
2 changed files with 19 additions and 0 deletions

View File

@ -282,6 +282,7 @@ public class Client {
} }
public func createStatus(text: String, public func createStatus(text: String,
contentType: StatusContentType = .plain,
inReplyTo: String? = nil, inReplyTo: String? = nil,
media: [Attachment]? = nil, media: [Attachment]? = nil,
sensitive: Bool? = nil, sensitive: Bool? = nil,
@ -290,6 +291,7 @@ public class Client {
language: String? = nil) -> Request<Status> { language: String? = nil) -> Request<Status> {
return Request<Status>(method: .post, path: "/api/v1/statuses", body: .parameters([ return Request<Status>(method: .post, path: "/api/v1/statuses", body: .parameters([
"status" => text, "status" => text,
"content_type" => contentType.mimeType,
"in_reply_to_id" => inReplyTo, "in_reply_to_id" => inReplyTo,
"sensitive" => sensitive, "sensitive" => sensitive,
"spoiler_text" => spoilerText, "spoiler_text" => spoilerText,

View File

@ -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
}
}