mirror of
https://git.phreedom.club/localhost_frssoft/bloat.git
synced 2024-11-22 12:01:27 +00:00
Disable scope selection when replying to a direct post
This commit is contained in:
parent
bd3f9ac966
commit
34c1d087af
|
@ -16,4 +16,5 @@ type ReplyContext struct {
|
|||
InReplyToID string
|
||||
InReplyToName string
|
||||
ReplyContent string
|
||||
ForceVisibility bool
|
||||
}
|
||||
|
|
|
@ -313,12 +313,9 @@ func (svc *service) ServeThreadPage(c *model.Client, id string, reply bool) (err
|
|||
}
|
||||
}
|
||||
|
||||
if c.Session.Settings.CopyScope {
|
||||
s, err := c.GetStatus(ctx, id)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
visibility = s.Visibility
|
||||
isDirect := status.Visibility == "direct"
|
||||
if isDirect || c.Session.Settings.CopyScope {
|
||||
visibility = status.Visibility
|
||||
} else {
|
||||
visibility = c.Session.Settings.DefaultVisibility
|
||||
}
|
||||
|
@ -330,6 +327,7 @@ func (svc *service) ServeThreadPage(c *model.Client, id string, reply bool) (err
|
|||
InReplyToID: id,
|
||||
InReplyToName: status.Account.Acct,
|
||||
ReplyContent: content,
|
||||
ForceVisibility: isDirect,
|
||||
},
|
||||
DarkMode: c.Session.Settings.DarkMode,
|
||||
}
|
||||
|
@ -351,7 +349,7 @@ func (svc *service) ServeThreadPage(c *model.Client, id string, reply bool) (err
|
|||
idNumbers[statuses[i].ID] = i + 1
|
||||
|
||||
statuses[i].IDReplies = replies
|
||||
addToReplyMap(replies, statuses[i].InReplyToID, statuses[i].ID, i + 1)
|
||||
addToReplyMap(replies, statuses[i].InReplyToID, statuses[i].ID, i+1)
|
||||
}
|
||||
|
||||
commonData := svc.getCommonData(c, "post by "+status.Account.DisplayName)
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
{{end}}
|
||||
<span class="post-form-field">
|
||||
<label for="post-visilibity"> Scope </label>
|
||||
<select id="post-visilibity" name="visibility">
|
||||
<select id="post-visilibity" name="visibility" {{if .ReplyContext}}{{if .ReplyContext.ForceVisibility}}disabled{{end}}{{end}}>
|
||||
<option value="public" {{if eq .DefaultVisibility "public"}}selected{{end}}>Public</option>
|
||||
<option value="unlisted" {{if eq .DefaultVisibility "unlisted"}}selected{{end}}>Unlisted</option>
|
||||
<option value="private" {{if eq .DefaultVisibility "private"}}selected{{end}}>Private</option>
|
||||
|
|
Loading…
Reference in a new issue