use local attachmentIDs variable
This commit is contained in:
parent
348d7ee00d
commit
df38f0f62f
1 changed files with 5 additions and 3 deletions
|
@ -151,7 +151,9 @@ func (c *CreateExecutor) createStatus(gtsClient *client.Client) error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if c.addPoll && !c.attachmentIDs.Empty() {
|
numAttachmentIDs := len(attachmentIDs)
|
||||||
|
|
||||||
|
if c.addPoll && numAttachmentIDs > 0 {
|
||||||
return fmt.Errorf("attaching media to a poll is not allowed")
|
return fmt.Errorf("attaching media to a poll is not allowed")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -204,8 +206,8 @@ func (c *CreateExecutor) createStatus(gtsClient *client.Client) error {
|
||||||
AttachmentIDs: nil,
|
AttachmentIDs: nil,
|
||||||
}
|
}
|
||||||
|
|
||||||
if !c.attachmentIDs.Empty() {
|
if numAttachmentIDs > 0 {
|
||||||
form.AttachmentIDs = c.attachmentIDs
|
form.AttachmentIDs = attachmentIDs
|
||||||
}
|
}
|
||||||
|
|
||||||
if c.addPoll {
|
if c.addPoll {
|
||||||
|
|
Loading…
Reference in a new issue