Phase 6 part 4: post as the LinkedIn company page

A second LinkedIn app (Community Management API) with its own sign-in on
Settings → Social accounts: the pages the member may post for are listed
and one chosen, new LinkedIn drafts default to the page or to you, and
each draft can switch before it's published. Schema 25.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-22 15:05:30 -07:00
co-authored by Claude Opus 5.5
parent 2c42857419
commit 98913971ea
20 changed files with 841 additions and 74 deletions
+13 -2
View File
@@ -74,9 +74,13 @@ func groupBatches(drafts []content.Draft) []*draftBatch {
func (s *Server) connected() map[string]bool {
out := map[string]bool{}
for id, p := range s.publishers() {
if _, expired := p.(expiredPublisher); !expired {
out[id] = true
if _, expired := p.(expiredPublisher); expired {
continue
}
if li, ok := p.(linkedInPublisher); ok && li.me == nil && li.page == nil {
continue // only expired sign-ins
}
out[id] = true
}
return out
}
@@ -100,6 +104,7 @@ func (s *Server) renderInbox(w http.ResponseWriter, r *http.Request, errMsg stri
"Sections": sections,
"Reddit": s.redditViews(r.Context(), pending),
"Connected": s.connected(),
"Page": s.liPageIfSignedIn(),
"Tagged": s.tagger() != nil,
"Now": time.Now().Add(time.Hour).Truncate(time.Hour).Format(dateTimeLocal),
"Zone": time.Now().Format("MST"),
@@ -246,6 +251,12 @@ func (s *Server) draftAction(w http.ResponseWriter, r *http.Request) {
return
}
}
if as, sent := r.PostForm["linkedin_as"]; sent {
if err := content.SetLinkedInAs(s.DB, id, as[0]); err != nil {
fail(err)
return
}
}
}
switch action {
case "save":