forked from shadowfacts/Tusker
Pachyderm: Add StatusContentType
This commit is contained in:
parent
07a79657a7
commit
30cd8991e8
|
@ -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<Status> {
|
||||
return Request<Status>(method: .post, path: "/api/v1/statuses", body: .parameters([
|
||||
"status" => text,
|
||||
"content_type" => contentType.mimeType,
|
||||
"in_reply_to_id" => inReplyTo,
|
||||
"sensitive" => sensitive,
|
||||
"spoiler_text" => spoilerText,
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue