moderator
.uverse.addressValue
<gnolang.StringValue>
pendingModerator
.uverse.addressValue
<zero>
TransferOwnership
func(newModerator .uverse.address)TransferOwnership stages a handoff of the moderator role. Moderator only; it takes effect only once newModerator calls AcceptOwnership. Calling it again before acceptance replaces the staged address, which is how a mistyped proposal is corrected.
- OID
- 0ad747…5fed:5
TransferOwnership details
AcceptOwnership
func()AcceptOwnership completes the handoff. Only the staged pendingModerator may call it — including against the outgoing moderator, so the two steps cannot be collapsed into one by the party giving up the role.
- OID
- 0ad747…5fed:7
AcceptOwnership details
CancelOwnershipTransfer
func()CancelOwnershipTransfer clears a staged handoff. Moderator only, so a proposal can be aborted without the proposed address cooperating.
- OID
- 0ad747…5fed:8
CancelOwnershipTransfer details
GetModerator
func() stringGetModerator returns the address that currently holds moderation.
- OID
- 0ad747…5fed:9
GetModerator details
GetPendingModerator
func() stringGetPendingModerator returns the staged successor ("" when none).
- OID
- 0ad747…5fed:10
GetPendingModerator details
assertModeratorCur
func()assertModeratorCur is the gate for this file's entrypoints. Named apart from the realm's existing assertModerator so the older call sites keep their signature and semantics untouched.
- OID
- 0ad747…5fed:11
assertModeratorCur details
MaxBodyLen
untyped bigint// review body
Value
(2000 <untyped> bigint)
MaxCommentLen
untyped bigint// comment body
Value
(1000 <untyped> bigint)
MaxPageLimit
untyped bigint// hard cap on any paginated read (DoS guard)
Value
(100 <untyped> bigint)
Review
type── Types ────────────────────────────────────────────────────
Value
memba_reviews_v2.Review
Comment
typeValue
memba_reviews_v2.Comment
reviews
*avl.Tree// strID(id) -> \*Review
- OID
- 0ad747…5fed:71
reviews details
comments
*avl.Tree// strID(id) -> \*Comment
- OID
- 0ad747…5fed:73
comments details
subjectIndex
*avl.Tree// subject -> \[]uint64 (review IDs, ascending) — bounds reads
- OID
- 0ad747…5fed:75
subjectIndex details
commentIndex
*avl.Tree// strID(reviewID) -> \[]uint64 (comment IDs, ascending)
- OID
- 0ad747…5fed:77
commentIndex details
authorSubject
*avl.Tree// subject + "\\x00" + author -> uint64 (reviewID) — one-per-pair
- OID
- 0ad747…5fed:79
authorSubject details
reactions
*avl.Tree// strID(targetID) + "/" + addr -> "like"|"dislike"
- OID
- 0ad747…5fed:81
reactions details
flags
*avl.Tree// strID(targetID) + "/" + addr -> true (one flag per acct/target)
- OID
- 0ad747…5fed:83
flags details
reputation
*avl.Tree// addr -> int64 (Σ likes−dislikes on their reviews+comments)
- OID
- 0ad747…5fed:85
reputation details
flaggedIDs
*avl.Tree// strID(targetID) -> true (visible targets with ≥1 flag, for the mod dashboard)
- OID
- 0ad747…5fed:87
flaggedIDs details
subjStatCount
*avl.Tree// subject -> int64 (# visible reviews)
- OID
- 0ad747…5fed:89
subjStatCount details
subjStatSum
*avl.Tree// subject -> int64 (Σ rating over visible reviews)
- OID
- 0ad747…5fed:91
subjStatSum details
nextID
uint64── State ────────────────────────────────────────────────────
Value
1
init.25
func()- OID
- 0ad747…5fed:24
init.25 details
getStat
func(t *avl.Tree, subject string) int64── RV-1 subject-stat counters (O(1) summary) ────────────────
- OID
- 0ad747…5fed:26
getStat details
applySubjectStat
func(subject string, dCount int64, dSum int64)applySubjectStat adjusts the visible-review counters for a subject. Callers apply a delta only when a review's \*counted\* state (visible = !Deleted && !Hidden) actually changes.
- OID
- 0ad747…5fed:27
applySubjectStat details
strID
func(id uint64) string── Helpers ──────────────────────────────────────────────────
- OID
- 0ad747…5fed:28
strID details
getReview
func(id uint64) (*memba_reviews_v2.Review, bool)- OID
- 0ad747…5fed:29
getReview details
getComment
func(id uint64) (*memba_reviews_v2.Comment, bool)- OID
- 0ad747…5fed:30
getComment details
assertModerator
func()- OID
- 0ad747…5fed:31
assertModerator details
getReputation
func(addr string) int64- OID
- 0ad747…5fed:32
getReputation details
addReputation
func(addr string, delta int64)- OID
- 0ad747…5fed:33
addReputation details
idList
func(t *avl.Tree, key string) []uint64- OID
- 0ad747…5fed:34
idList details
removeID
func(ids []uint64, target uint64) []uint64removeID returns ids with the first occurrence of target removed.
- OID
- 0ad747…5fed:35
removeID details
sanitizeForRender
func(s string) stringsanitizeForRender strips markdown/HTML-sensitive chars from user strings used inside Render() markdown (defense-in-depth; the frontend also DOMPurifies). "&" is escaped FIRST to prevent entity-injection (e.g. "<" → "&lt;").
- OID
- 0ad747…5fed:36
sanitizeForRender details
jsonEscape
func(s string) stringjsonEscape escapes a string for embedding in the realm's hand-built JSON.
- OID
- 0ad747…5fed:37
jsonEscape details
validRating
func(r int) bool- OID
- 0ad747…5fed:38
validRating details
validBody
func(b string) bool- OID
- 0ad747…5fed:39
validBody details
pairKey
func(subject string, a .uverse.address) stringpairKey returns the authorSubject tree key for a (subject, author) pair. The NUL separator prevents prefix collisions between subject and author.
- OID
- 0ad747…5fed:40
pairKey details
PostReview
func(subject string, rating int, body string)PostReview creates the caller's review for \`subject\`, or replaces it in place if one already exists (the "one editable review per pair" rule).
- OID
- 0ad747…5fed:41
PostReview details
EditReview
func(reviewID uint64, rating int, body string)EditReview updates rating + body of an existing non-deleted review. Only the original author may edit.
- OID
- 0ad747…5fed:42
EditReview details
DeleteReview
func(reviewID uint64)DeleteReview tombstones the caller's review: keeps the ID + reaction history, clears the body, and frees the (author, subject) pair for a fresh review. Only the original author may delete.
- OID
- 0ad747…5fed:43
DeleteReview details
validComment
func(b string) boolvalidComment returns true iff body is non-empty and within MaxCommentLen.
- OID
- 0ad747…5fed:44
validComment details
PostComment
func(reviewID uint64, body string)PostComment posts a flat reply to an existing, non-deleted, non-hidden review.
- OID
- 0ad747…5fed:45
PostComment details
EditComment
func(commentID uint64, body string)EditComment updates the body of an existing, non-deleted comment. Only the original author may edit.
- OID
- 0ad747…5fed:46
EditComment details
DeleteComment
func(commentID uint64)DeleteComment tombstones the caller's comment: clears the body. Only the original author may delete.
- OID
- 0ad747…5fed:47
DeleteComment details
boolToInt
func(b bool) int- OID
- 0ad747…5fed:48
boolToInt details
reactionDelta
func(old string, newKind string) (likesDelta int, dislikesDelta int, repDelta int)reactionDelta returns how a reaction change (old -> newKind, each "" | "like" | "dislike") moves the target's like count, dislike count, and the target author's reputation. repDelta = likesDelta - dislikesDelta.
- OID
- 0ad747…5fed:49
reactionDelta details
applyDelta
func(v uint64, delta int) uint64applyDelta adjusts an unsigned counter by ±1-style delta without underflow.
- OID
- 0ad747…5fed:50
applyDelta details
React
func(targetID uint64, kind string)React records or toggles a like/dislike on a review or comment. Re-reacting with the same kind toggles it off; switching kind replaces it. Updates the target's Likes/Dislikes counters and the author's reputation by Δ(likes−dislikes). Self-reactions are rejected. Deleted/hidden targets are rejected.
- OID
- 0ad747…5fed:51
React details
Flag
func(targetID uint64)Flag records one community flag per account per target (review or comment). Auto-hide is NOT performed here; takedowns are multisig-only (HideReview/HideComment). Deleted/hidden targets are rejected.
- OID
- 0ad747…5fed:52
Flag details
HideReview
func(id uint64)HideReview soft-deletes a review. Moderator (multisig) only.
- OID
- 0ad747…5fed:53
HideReview details
HideComment
func(id uint64)HideComment soft-deletes a comment. Moderator (multisig) only.
- OID
- 0ad747…5fed:54
HideComment details
Unhide
func(targetID uint64)Unhide reverses a hide (manual or auto-flag) on a review or comment. Moderator (multisig) only. Also removes the target from the mod dashboard index.
- OID
- 0ad747…5fed:55
Unhide details
clampLimit
func(limit int) intclampLimit ensures limit is in \[1, MaxPageLimit]. Zero or negative values and values above MaxPageLimit are all clamped to MaxPageLimit.
- OID
- 0ad747…5fed:56
clampLimit details
window
func(ids []uint64, offset int, limit int) []uint64window slices ids\[offset : offset+limit] safely (no panics on out-of-range).
- OID
- 0ad747…5fed:57
window details
reviewJSON
func(r *memba_reviews_v2.Review) string- OID
- 0ad747…5fed:58
reviewJSON details
commentJSON
func(c *memba_reviews_v2.Comment) string- OID
- 0ad747…5fed:59
commentJSON details
GetReviewsJSON
func(subject string, offset int, limit int) stringGetReviewsJSON returns a JSON array of a subject's non-hidden reviews (paginated). Deleted reviews are included as tombstones (empty body, deleted:true).
- OID
- 0ad747…5fed:60
GetReviewsJSON details
GetCommentsJSON
func(reviewID uint64, offset int, limit int) stringGetCommentsJSON returns a JSON array of a review's non-hidden comments (paginated).
- OID
- 0ad747…5fed:61
GetCommentsJSON details
GetSubjectSummaryJSON
func(subject string) stringGetSubjectSummaryJSON returns {"count":N,"average":A,"sum":S} over non-hidden, non-deleted reviews for a subject. Average is integer-rounded. GetSubjectSummaryJSON returns the count/average/sum of a subject's VISIBLE reviews. RV-1: O(1) — reads the maintained per-subject counters instead of scanning the (sybil- growable) review list, so it can never exceed the query gas cap.
- OID
- 0ad747…5fed:62
GetSubjectSummaryJSON details
GetReputation
func(addr string) int64GetReputation returns the net likes−dislikes reputation for an address. Returns 0 for unknown addresses. Queried via vm/qeval (bare int64).
- OID
- 0ad747…5fed:63
GetReputation details
GetFlaggedJSON
func(offset int, limit int) stringGetFlaggedJSON returns a JSON array of flagged target IDs for the mod dashboard, paginated. IDs are returned as bare integers (not quoted strings). Uses early-stop iteration to avoid loading the entire tree.
- OID
- 0ad747…5fed:64
GetFlaggedJSON details
Render
func(path string) stringRender — human gnoweb view. "" → home (total count); "s/\<subject>" → subject review list; else 404.
- OID
- 0ad747…5fed:65
Render details
ModerationState
typeModerationState is a bounded copied snapshot, including hidden/deleted items. No pointer or body is exposed. BodyHash binds edits even within the same block. Reactions and cumulative flag counts are not moderation authorization inputs.
Value
memba_reviews_v2.ModerationState
moderationBodyHash
func(body string) string- OID
- 0ad747…5fed:66
moderationBodyHash details
GetModerationState
func(id uint64) memba_reviews_v2.ModerationStateGetModerationState returns a zero value for an absent ID. The flagged-index bit is distinct from historical flags; Unhide removes only the index entry.
- OID
- 0ad747…5fed:68
GetModerationState details
publisherAtLoad
func() .uverse.address- OID
- 0ad747…5fed:69