forum: let non-members browse a public forum's topic list

ListForumTopics / GetForumTopicsByID / GeneralForumTopic gated on
membership while channel history uses the public-preview path, so a
public forum's topics (General included) were invisible until you joined.
Switch them to getChannelForViewer / channelForViewerLocked; private
forums and write paths keep the membership gate.
This commit is contained in:
Astra 2026-09-09 11:15:56 +01:00
parent 57b7829a9e
commit f0bf315bf3
5 changed files with 108 additions and 6 deletions

View file

@ -198,7 +198,7 @@ func (s *ChannelStore) GeneralForumTopic(ctx context.Context, viewerUserID, chan
if viewerUserID == 0 || channelID == 0 {
return domain.ChannelForumTopic{}, domain.ErrChannelInvalid
}
channel, member, err := s.getChannelForMember(ctx, s.db, viewerUserID, channelID)
channel, member, _, err := s.getChannelForViewer(ctx, s.db, viewerUserID, channelID)
if err != nil {
return domain.ChannelForumTopic{}, err
}