Compare commits
3 commits
87d8f0ad04
...
1cd451ae72
Author | SHA1 | Date | |
---|---|---|---|
1cd451ae72 | |||
e49da231d4 | |||
fb3453f5a0 |
5 changed files with 4 additions and 27 deletions
|
@ -184,7 +184,7 @@ func NewCreateExecutor(
|
|||
exe.BoolVar(&exe.pollHidesVoteCounts, "poll-hides-vote-counts", false, "Set to true to hide the vote count until the poll is closed")
|
||||
exe.Var(&exe.pollOptions, "poll-option", "A poll option. Use this multiple times to set multiple options")
|
||||
exe.Var(&exe.sensitive, "sensitive", "Set to true if the status should be marked as sensitive")
|
||||
exe.StringVar(&exe.spoilerText, "spoiler-text", "", "The subject, summary or content warning for the status")
|
||||
exe.StringVar(&exe.spoilerText, "spoiler-text", "", "The text to display as the status' warning or subject")
|
||||
exe.StringVar(&exe.resourceType, "type", "", "The type of resource you want to action on (e.g. account, status)")
|
||||
exe.StringVar(&exe.visibility, "visibility", "", "The visibility of the posted status")
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ type Status struct {
|
|||
ReblogsCount int `json:"reblogs_count"`
|
||||
RepliesCount int `json:"replies_count"`
|
||||
Sensitive bool `json:"sensitive"`
|
||||
SpoilerText string `json:"spoiler_text"`
|
||||
SpolierText string `json:"spoiler_text"`
|
||||
Tags []Tag `json:"tags"`
|
||||
Text string `json:"text"`
|
||||
URI string `json:"uri"`
|
||||
|
@ -83,7 +83,7 @@ type StatusReblogged struct {
|
|||
RebloggsCount int `json:"reblogs_count"`
|
||||
RepliesCount int `json:"replies_count"`
|
||||
Sensitive bool `json:"sensitive"`
|
||||
SpoilerText string `json:"spoiler_text"`
|
||||
SpolierText string `json:"spoiler_text"`
|
||||
Tags []Tag `json:"tags"`
|
||||
Text string `json:"text"`
|
||||
URI string `json:"uri"`
|
||||
|
|
|
@ -27,7 +27,6 @@ const (
|
|||
|
||||
type theme struct {
|
||||
reset string
|
||||
bold string
|
||||
boldblue string
|
||||
boldmagenta string
|
||||
green string
|
||||
|
@ -54,7 +53,6 @@ func NewPrinter(
|
|||
) *Printer {
|
||||
theme := theme{
|
||||
reset: "\033[0m",
|
||||
bold: "\033[1m",
|
||||
boldblue: "\033[34;1m",
|
||||
boldmagenta: "\033[35;1m",
|
||||
green: "\033[32m",
|
||||
|
@ -117,14 +115,6 @@ func (p Printer) fieldFormat(text string) string {
|
|||
return p.theme.green + text + p.theme.reset
|
||||
}
|
||||
|
||||
func (p Printer) bold(text string) string {
|
||||
if p.noColor {
|
||||
return text
|
||||
}
|
||||
|
||||
return p.theme.bold + text + p.theme.reset
|
||||
}
|
||||
|
||||
func (p Printer) fullDisplayNameFormat(displayName, acct string) string {
|
||||
// use this pattern to remove all emoji strings
|
||||
pattern := regexp.MustCompile(`\s:[A-Za-z0-9_]*:`)
|
||||
|
|
|
@ -18,12 +18,6 @@ func (p Printer) PrintStatus(status model.Status, userAccountID string) {
|
|||
builder.WriteString("\n\n" + p.headerFormat("STATUS ID:"))
|
||||
builder.WriteString("\n" + status.ID)
|
||||
|
||||
// The subject, summary of content warning of the status
|
||||
if status.SpoilerText != "" {
|
||||
builder.WriteString("\n\n" + p.headerFormat("SUMMARY:"))
|
||||
builder.WriteString("\n" + status.SpoilerText)
|
||||
}
|
||||
|
||||
// The content of the status.
|
||||
builder.WriteString("\n\n" + p.headerFormat("CONTENT:"))
|
||||
builder.WriteString(p.convertHTMLToText(status.Content, true))
|
||||
|
@ -103,7 +97,6 @@ func (p Printer) statusList(list model.StatusList, userAccountID string) string
|
|||
content := status.Content
|
||||
poll := status.Poll
|
||||
mediaAttachments := status.MediaAttachments
|
||||
summary := status.SpoilerText
|
||||
|
||||
switch {
|
||||
case status.Reblog != nil:
|
||||
|
@ -122,8 +115,6 @@ func (p Printer) statusList(list model.StatusList, userAccountID string) string
|
|||
content = status.Reblog.Content
|
||||
poll = status.Reblog.Poll
|
||||
mediaAttachments = status.Reblog.MediaAttachments
|
||||
summary = status.Reblog.SpoilerText
|
||||
|
||||
case status.InReplyToID != "":
|
||||
builder.WriteString("\n" + p.wrapLines(
|
||||
p.fullDisplayNameFormat(status.Account.DisplayName, status.Account.Acct)+
|
||||
|
@ -136,10 +127,6 @@ func (p Printer) statusList(list model.StatusList, userAccountID string) string
|
|||
builder.WriteString("\n" + p.fullDisplayNameFormat(status.Account.DisplayName, status.Account.Acct) + " posted:")
|
||||
}
|
||||
|
||||
if summary != "" {
|
||||
builder.WriteString("\n\n" + p.bold(p.wrapLines(summary, 0)))
|
||||
}
|
||||
|
||||
builder.WriteString("\n" + p.convertHTMLToText(content, true))
|
||||
|
||||
if poll != nil {
|
||||
|
|
|
@ -174,7 +174,7 @@
|
|||
},
|
||||
"spoiler-text": {
|
||||
"type": "string",
|
||||
"description": "The subject, summary or content warning for the status"
|
||||
"description": "The text to display as the status' warning or subject"
|
||||
},
|
||||
"status-id": {
|
||||
"type": "string",
|
||||
|
|
Loading…
Reference in a new issue