Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IsolationProtocol ¶
type IsolationProtocol struct {
// contains filtered or unexported fields
}
IsolationProtocol implements shadow-ban semantics. The offender's own node never receives the verdict — it is published only on the followers/observers pubsub topic. The offender therefore cannot detect or resist isolation; their local view stays unchanged while everyone else hides the offending object.
func NewIsolationProtocol ¶
func NewIsolationProtocol(pub Publisher) *IsolationProtocol
func (*IsolationProtocol) IsolateTweet ¶
func (ip *IsolationProtocol) IsolateTweet(t *domain.Tweet, m *domain.TweetModeration)
IsolateTweet broadcasts a tweet moderation verdict on the offender's followers topic. Subscribers apply the verdict via StreamModerationResultHandler and re-render with the moderation flag.
func (*IsolationProtocol) IsolateUser ¶ added in v0.7.59
func (ip *IsolationProtocol) IsolateUser(moderatorID domain.ID, u *domain.User, m *domain.UserModeration)
IsolateUser broadcasts a profile-level moderation verdict on the offender's followers topic. Followers cache the user with Moderation.IsModerated = true and clients hide bio / name / website / custom fields on the next render. The user row stays on disk; nothing is wiped.
type Publisher ¶
Publisher is the slice of moderator pubsub the isolation protocol needs: publish a verdict onto the offender's followers topic so every observer re-renders the object with the moderation flag set. The implementation marshals `body` once on the way out — callers MUST pass a struct (or any non-[]byte value) so the result is a real JSON object on the wire, not a base64-encoded blob.